/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* TKI Colors - Tema Escuro com Verde */
    --primary: #00ff88;
    --primary-dark: #00cc6d;
    --primary-light: #33ffaa;
    --secondary: #00dd77;
    --accent: #00ff88;
    --background: #0a0f0a;
    --surface: #141a14;
    --surface-light: #1f261f;
    --text-primary: #e8f5e9;
    --text-secondary: #81c784;
    --border: #1f3a1f;
    --overlay: rgba(10, 15, 10, 0.95);
    --success: #00ff88;
    --gradient: linear-gradient(135deg, #00ff88 0%, #00cc6d 100%);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-lg) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.header-content {
    text-align: center;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.logo-image {
    max-height: 50px;
    height: auto;
    width: auto;
    max-width: 250px;
    filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.3));
    transition: var(--transition);
}

.logo-image:hover {
    filter: drop-shadow(0 0 30px rgba(0, 255, 136, 0.5));
    transform: scale(1.05);
}

.logo-fallback {
    font-size: 2rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--primary);
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.5));
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   Main Content
   ======================================== */
.main {
    flex: 1;
    padding: var(--spacing-xl) 0;
}


/* ========================================
   Video Grid
   ======================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border);
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.thumbnail-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.video-card:hover .thumbnail-video {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: var(--transition);
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 4rem;
    height: 4rem;
    color: white;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    transition: var(--transition);
}

.video-card:hover .play-icon {
    transform: scale(1.1);
    color: var(--primary-light);
}

.video-info {
    padding: var(--spacing-md);
}

.video-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-description::before {
    content: "▶";
    color: var(--primary);
    font-size: 0.8rem;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: 500px;
    margin: var(--spacing-xl) auto;
}

.empty-icon {
    width: 5rem;
    height: 5rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.empty-state code {
    background: var(--surface);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    color: var(--primary-light);
    border: 1px solid var(--border);
}

/* ========================================
   Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 1.5rem;
    height: 1.5rem;
}

.modal-video-container {
    position: relative;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    max-height: 80vh;
}

.modal-video-container video {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Suporte para vídeos verticais (formato celular) */
.modal-video-container video.vertical-video {
    width: auto;
    max-width: 100%;
    height: 80vh;
}

.modal-info {
    padding: var(--spacing-lg);
    background: var(--surface);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.modal-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Modal Navigation Arrows */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.modal-nav:hover {
    background: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav svg {
    width: 1.5rem;
    height: 1.5rem;
}

.modal-nav-prev {
    left: var(--spacing-md);
}

.modal-nav-next {
    right: var(--spacing-md);
}

.modal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-nav:disabled:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-50%);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--spacing-lg) 0;
    text-align: center;
    margin-top: auto;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablets */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
    }

    .logo-image {
        max-height: 45px;
        max-width: 200px;
    }

    .logo-fallback {
        font-size: 1.5rem;
    }

    .logo-icon {
        width: 2rem;
        height: 2rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }

    .stat-value {
        font-size: 2rem;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-nav {
        width: 2.5rem;
        height: 2.5rem;
    }

    .modal-nav-prev {
        left: var(--spacing-sm);
    }

    .modal-nav-next {
        right: var(--spacing-sm);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .header {
        padding: var(--spacing-md) 0;
    }

    .logo-image {
        max-height: 40px;
        max-width: 180px;
    }

    .logo-fallback {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .main {
        padding: var(--spacing-lg) 0;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .video-title {
        font-size: 1rem;
    }

    .video-description {
        font-size: 0.85rem;
    }

    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        width: 2rem;
        height: 2rem;
    }

    .modal-close svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .modal-info {
        padding: var(--spacing-md);
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-meta {
        font-size: 0.85rem;
    }

    .modal-nav {
        width: 2rem;
        height: 2rem;
    }

    .modal-nav svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .play-icon {
        width: 3rem;
        height: 3rem;
    }

    .empty-icon {
        width: 4rem;
        height: 4rem;
    }

    .empty-state h2 {
        font-size: 1.25rem;
    }

    .empty-state p {
        font-size: 0.9rem;
    }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .modal-video-container {
        min-height: 90vh;
        max-height: 90vh;
    }

    .modal-video-container video {
        max-height: 90vh;
    }

    .modal-info {
        display: none;
    }
}

/* Mobile Portrait - Vídeos Verticais */
@media (max-width: 480px) and (orientation: portrait) {
    .modal-video-container {
        min-height: 60vh;
        max-height: 70vh;
    }

    .modal-video-container video.vertical-video {
        height: 70vh;
        width: auto;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .play-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.3);
    }

    .play-icon {
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: subpixel-antialiased;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (already dark by default, but can be enhanced) */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0a0f1e;
        --surface: #151b2e;
    }
}
