/* -------------------------------------------------------------
   Plataforma de Cursos SisGEn - Sistema de Estilo Premium
   ------------------------------------------------------------- */

/* 1. Global Custom Variables (Based on SisGEn Identity) */
:root {
    --bg-dark: #090c10;
    --bg-card: #121820;
    --primary-blue: #1e3a8a; /* SisGEn Core Blue */
    --primary-light: #3b82f6; /* SisGEn Accent Blue */
    --text-white: #ffffff;
    --text-gray: #9ca3af;
    --text-muted: #6b7280;
    --neon-red: #ef4444; /* Unwatched */
    --neon-green: #10b981; /* Watched */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-speed: 0.3s;
}

/* 2. Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-family);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Hide scrollbar defaults */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.hidden {
    display: none !important;
}

/* 3. NETFLIX-STYLE INTRO ANIMATION */
.intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    overflow: hidden;
    animation: fadeOutIntro 0.5s ease 3.5s forwards; /* Fades out after 3.5 seconds total */
}

.intro-logo-wrapper {
    text-align: center;
    position: relative;
}

.netflix-logo-text {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--primary-blue);
    text-shadow: 0 0 20px rgba(30, 58, 138, 0.6);
    transform: scale(0.6);
    opacity: 0;
    animation: zoomAndGlow 3.5s cubic-bezier(0.21, 0.6, 0.35, 1) forwards;
}

.netflix-logo-text span {
    color: var(--primary-light);
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
}

.intro-subtext {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 6px;
    color: var(--text-gray);
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInSubtext 1s ease 1s forwards;
}

.skip-btn {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.2s ease;
}

.skip-btn:hover {
    background: var(--text-white);
    color: #000000;
    transform: scale(1.05);
}

/* Animations Keyframes */
@keyframes zoomAndGlow {
    0% {
        transform: scale(0.4);
        opacity: 0;
        filter: blur(10px);
    }
    10% {
        opacity: 1;
        filter: blur(0px);
    }
    40% {
        text-shadow: 0 0 30px rgba(30, 58, 138, 0.8), 0 0 50px rgba(59, 130, 246, 0.6);
    }
    85% {
        opacity: 1;
        transform: scale(1.1);
        filter: blur(0px);
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
        filter: blur(5px);
    }
}

@keyframes fadeInSubtext {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutIntro {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* 4. MAIN LAYOUT & NAVBAR */
.main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-img {
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-blue);
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--primary-light);
}

.admin-link {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) ease;
}

.admin-link:hover {
    background: var(--primary-blue);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

/* 5. HERO / FEATURED BANNER SECTION */
.hero-banner {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    padding: 0 4%;
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(to right, rgba(9, 12, 16, 0.9) 30%, rgba(9, 12, 16, 0.2) 70%), url('https://images.unsplash.com/photo-1516321318423-f06f85e504b3?w=1600&auto=format&fit=crop');
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, var(--bg-dark), rgba(9, 12, 16, 0));
    pointer-events: none;
}

.hero-content {
    max-width: 600px;
    z-index: 10;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary-blue);
    border: 1px solid var(--primary-light);
    color: var(--text-white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 850;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-description {
    font-size: 1rem;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 1.6rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-play {
    background-color: var(--primary-light);
    color: var(--text-white);
}

.btn-play:hover {
    background-color: #2563eb;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

/* 6. CATEGORIES & CAROUSELS */
.rows-container {
    padding: 2rem 4% 4rem;
    position: relative;
    z-index: 20;
    margin-top: -80px;
}

.category-row {
    margin-bottom: 3.5rem;
}

.row-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-white);
}

.row-title i {
    color: var(--primary-light);
}

.row-outer-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.row-inner-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0.5rem;
    width: 100%;
}

.row-inner-carousel::-webkit-scrollbar {
    display: none; /* Hide scrollbar for seamless touch-experience */
}

/* Scroll buttons (Netflix-Style) */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-white);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    opacity: 0;
}

.row-outer-wrapper:hover .scroll-btn {
    opacity: 1;
}

.scroll-btn:hover {
    background: var(--primary-blue);
    border-color: var(--primary-light);
    transform: translateY(-50%) scale(1.1);
}

.scroll-btn.prev {
    left: -15px;
}

.scroll-btn.next {
    right: -15px;
}

/* 7. VIDEO CARD CONTAINERS (With NEON Outlines) */
.video-card {
    flex: 0 0 280px;
    height: 180px;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

/* Unwatched (Neon Red Border/Glow) */
.video-card.unwatched {
    border: 2px solid var(--neon-red);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Watched (Neon Green Border/Glow) */
.video-card.watched {
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Card Hover effect (Netflix zoom-out style) */
.video-card:hover {
    transform: scale(1.08) translateY(-5px);
    z-index: 30;
}

.video-card.unwatched:hover {
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.9), 0 4px 15px rgba(0,0,0,0.5);
}

.video-card.watched:hover {
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.9), 0 4px 15px rgba(0,0,0,0.5);
}

/* Card Thumbnail */
.card-thumbnail {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: rgba(255,255,255,0.25);
}

/* Card Content / Hover Panel Overlay */
.card-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 50%, rgba(0,0,0,0) 100%);
    padding: 1.2rem 0.8rem 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.video-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.status-badge {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.video-card.unwatched .status-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid var(--neon-red);
}

.video-card.watched .status-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid var(--neon-green);
}

.play-hover-btn {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
    opacity: 0;
    transition: all 0.2s ease;
}

.video-card:hover .play-hover-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Empty row text placeholder */
.empty-row-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 1.5rem;
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 8px;
    width: 100%;
    text-align: center;
}

/* 8. VIDEO PLAYER MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    z-index: 1010;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    animation: zoomIn 0.3s ease;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 1020;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: var(--neon-red);
    border-color: var(--neon-red);
    transform: scale(1.1);
}

.video-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.video-wrapper iframe, 
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-info-panel {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.modal-info-panel h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.category-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--primary-blue);
    color: white;
    font-size: 0.75rem;
    font-weight: 750;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.modal-info-panel p {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 9. ADMIN PANEL STYLING */
.admin-body {
    background-color: #0c0f13;
    padding: 2rem 4%;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #1a222e;
    padding-bottom: 1.5rem;
}

.admin-title-area h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-white);
    margin-top: 0.8rem;
}

.admin-title-area p {
    color: var(--text-gray);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.back-btn:hover {
    color: var(--text-white);
    transform: translateX(-3px);
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid #1a222e;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.admin-card-header {
    background: #171f2a;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #1a222e;
}

.admin-card-header h2 {
    font-size: 1.15rem;
    font-weight: 750;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.admin-card-header h2 i {
    color: var(--primary-light);
}

.admin-card-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #090c10;
    border: 1px solid #2d3748;
    border-radius: 6px;
    color: white;
    font-family: var(--font-family);
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: block;
}

.btn-save {
    background-color: var(--primary-blue);
    border: 1px solid var(--primary-light);
    color: white;
    width: 100%;
}

.btn-save:hover {
    background-color: var(--primary-light);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.btn-add {
    background-color: var(--primary-light);
    color: white;
    width: 100%;
}

.btn-add:hover {
    background-color: #2563eb;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.admin-actions-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-warning {
    background-color: #d97706;
    color: white;
}

.btn-warning:hover {
    background-color: #b45309;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Logo Previews */
.logo-preview-container {
    margin-top: 1rem;
    background: #000;
    padding: 1rem;
    border-radius: 6px;
    display: flex;
    justify-content: center;
}

.logo-preview-container img {
    max-height: 50px;
    object-fit: contain;
}

/* Management Table */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.admin-table th {
    background: #171f2a;
    padding: 0.8rem 1rem;
    font-weight: 700;
    color: var(--text-gray);
    border-bottom: 2px solid #1a222e;
}

.admin-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #1a222e;
    color: var(--text-gray);
}

.admin-table tr:hover td {
    color: white;
    background-color: rgba(255,255,255,0.02);
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--neon-red);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.4rem;
    transition: transform 0.2s ease;
}

.btn-delete:hover {
    transform: scale(1.2);
    color: #fca3a3;
}

/* 10. TOAST NOTIFICATION */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #171f2a;
    border-left: 4px solid var(--primary-light);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 10000;
    font-weight: 600;
    animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 11. FOOTER */
.main-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid #111827;
    background-color: #06080c;
    margin-top: auto;
}
