/**
 * Estilos CSS para a parte pública do plugin Achados em Vídeo
 */

/* === GRID DE VÍDEOS === */
.achados-videos-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.achados-videos-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.achados-videos-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.achados-videos-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.achados-videos-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.achados-videos-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.achados-videos-grid[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* === ITEM DE VÍDEO === */
.achados-video-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.achados-video-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* === THUMBNAIL === */
.achados-video-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.achados-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.achados-video-item:hover .achados-video-thumbnail img {
    transform: scale(1.05);
}

/* === OVERLAY === */
.achados-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.achados-video-item:hover .achados-video-overlay {
    opacity: 1;
}

.achados-video-play-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    font-size: 0;
}

.achados-video-play-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.achados-video-play-btn .play-icon {
    font-size: 20px;
    color: #333;
    margin-left: 3px;
}

/* === CATEGORIA === */
.achados-video-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #007cba;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === CONTEÚDO === */
.achados-video-content {
    padding: 15px;
}

.achados-video-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.achados-video-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === TAGS === */
.achados-video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.achados-video-tag {
    background: #f0f0f0;
    color: #666;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

.achados-video-tag:hover {
    background: #e0e0e0;
    color: #333;
}

/* === META INFORMAÇÕES === */
.achados-video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.achados-video-views,
.achados-video-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.achados-video-views::before {
    content: "👁";
    font-size: 10px;
}

.achados-video-date::before {
    content: "📅";
    font-size: 10px;
}

/* === VÍDEO ÚNICO === */
.achados-single-video {
    max-width: 800px;
    margin: 20px auto;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.achados-single-video-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #333;
    padding: 20px 20px 0 20px;
}

.achados-single-video-player {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.achados-single-video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.achados-single-video-description {
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

.achados-single-video-meta {
    padding: 0 20px 20px 20px;
}

.achados-single-video-category {
    display: inline-block;
    background: #007cba;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.achados-single-video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.achados-single-video-tag {
    background: #f0f0f0;
    color: #666;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.achados-single-video-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #777;
}

/* === LISTA DE CATEGORIAS === */
.achados-categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.achados-category-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: box-shadow 0.2s;
}

.achados-category-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.achados-category-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.achados-category-content {
    flex: 1;
}

.achados-category-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
}

.achados-category-count {
    font-weight: normal;
    color: #666;
    font-size: 14px;
}

.achados-category-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* === MODAL DE VÍDEO === */
.achados-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.achados-video-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.achados-video-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.achados-video-modal-close:hover {
    background: rgba(0,0,0,0.9);
}

.achados-video-modal-body {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

#achados-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#achados-video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* === LOADING === */
.achados-video-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.achados-video-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: achados-video-spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes achados-video-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === MENSAGENS === */
.achados-videos-empty {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.achados-video-error {
    text-align: center;
    padding: 20px;
    color: #d63638;
    background: #fff2f2;
    border: 1px solid #f0c2c2;
    border-radius: 6px;
    margin: 20px 0;
}

/* === BOTÃO CARREGAR MAIS === */
.achados-video-load-more {
    text-align: center;
    margin: 30px 0;
}

.achados-video-load-more-btn {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.achados-video-load-more-btn:hover {
    background: #005a87;
}

.achados-video-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* === FILTROS PÚBLICOS === */
.achados-video-filters {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.achados-video-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.achados-video-filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.achados-video-filter-select,
.achados-video-filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.achados-video-filter-select:focus,
.achados-video-filter-input:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.1);
}

/* === RESPONSIVO === */
@media (max-width: 768px) {
    .achados-videos-grid[data-columns="2"],
    .achados-videos-grid[data-columns="3"],
    .achados-videos-grid[data-columns="4"],
    .achados-videos-grid[data-columns="5"],
    .achados-videos-grid[data-columns="6"] {
        grid-template-columns: 1fr;
    }
    
    .achados-video-thumbnail {
        height: 180px;
    }
    
    .achados-video-play-btn {
        width: 50px;
        height: 50px;
    }
    
    .achados-video-play-btn .play-icon {
        font-size: 16px;
    }
    
    .achados-single-video {
        margin: 10px;
        border-radius: 6px;
    }
    
    .achados-single-video-title {
        font-size: 20px;
        padding: 15px 15px 0 15px;
    }
    
    .achados-single-video-description {
        padding: 15px;
        font-size: 15px;
    }
    
    .achados-single-video-meta {
        padding: 0 15px 15px 15px;
    }
    
    .achados-categories-list {
        grid-template-columns: 1fr;
    }
    
    .achados-video-modal {
        padding: 10px;
    }
    
    .achados-video-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .achados-video-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .achados-video-filter-group {
        justify-content: space-between;
    }
    
    .achados-video-filter-select,
    .achados-video-filter-input {
        flex: 1;
        min-width: 0;
    }
    
    .achados-video-meta {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    .achados-single-video-stats {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .achados-video-content {
        padding: 12px;
    }
    
    .achados-video-title {
        font-size: 15px;
    }
    
    .achados-video-description {
        font-size: 13px;
    }
    
    .achados-video-thumbnail {
        height: 160px;
    }
    
    .achados-single-video-title {
        font-size: 18px;
    }
    
    .achados-video-modal-close {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* === ACESSIBILIDADE === */
.achados-video-item:focus,
.achados-video-play-btn:focus,
.achados-video-modal-close:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.achados-video-item:focus {
    outline-offset: -2px;
}

/* === ANIMAÇÕES === */
@media (prefers-reduced-motion: reduce) {
    .achados-video-item,
    .achados-video-thumbnail img,
    .achados-video-overlay,
    .achados-video-play-btn,
    .achados-video-tag,
    .achados-video-spinner {
        transition: none;
        animation: none;
    }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    .achados-video-item {
        background: #2c2c2c;
        color: #fff;
    }
    
    .achados-video-title {
        color: #fff;
    }
    
    .achados-video-description {
        color: #ccc;
    }
    
    .achados-video-meta {
        color: #999;
        border-top-color: #444;
    }
    
    .achados-single-video {
        background: #2c2c2c;
    }
    
    .achados-single-video-title {
        color: #fff;
    }
    
    .achados-single-video-description {
        color: #ccc;
    }
    
    .achados-category-item {
        background: #2c2c2c;
        border-color: #444;
    }
    
    .achados-category-name {
        color: #fff;
    }
    
    .achados-category-description {
        color: #ccc;
    }
    
    .achados-video-filters {
        background: #2c2c2c;
    }
    
    .achados-video-filter-label {
        color: #fff;
    }
    
    .achados-video-filter-select,
    .achados-video-filter-input {
        background: #444;
        border-color: #666;
        color: #fff;
    }
}