:root {
    /* Cores de Tema Estilo Netflix/Premium App */
    --bg-darker: #050505;
    --bg-dark: #141414;
    --bg-surface: #222222;
    --bg-surface-light: #333333;
    
    --primary-color: #10b981; /* Emerald */
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.5);
    
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #777777;
    
    --border-color: rgba(255,255,255,0.1);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --nav-height: 70px;
    --bottom-nav-height: 65px;
    
    /* Z-Index architecture */
    --z-bottom-nav: 50;
    --z-header: 40;
    --z-modal: 100;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-darker);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* Esconder barra de rolagem mas manter funcional (App feel) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-light);
    border-radius: 10px;
}

/* -------------------------------------
 * APLICATIVO BASE & VIEWS SPA
 * ------------------------------------- */
#app-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* Controle de Views */
main {
    display: none;
    animation: fadeIn 0.3s ease;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

main.active {
    display: block;
}

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

.bottom-spacer {
    height: calc(var(--bottom-nav-height) + 20px);
}

/* -------------------------------------
 * HEADER 
 * ------------------------------------- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: linear-gradient(to bottom, rgba(5,5,5,0.9) 0%, rgba(5,5,5,0) 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4%;
    z-index: var(--z-header);
    transition: background 0.3s ease;
}

.app-header.scrolled {
    background: rgba(20, 20, 20, 0.95);
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.back-btn:hover {
    background-color: var(--primary-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-icon {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.logo h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo .highlight {
    color: var(--text-secondary);
    font-weight: 400;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-btn {
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-primary);
}

.avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

/* -------------------------------------
 *  VIEW 1: CATÁLOGO (HOME NETFLIX)
 * ------------------------------------- */

/* Hero Especial de Destaque */
.hero-showcase {
    position: relative;
    height: 65vh;
    min-height: 400px;
    margin-top: calc(-1 * var(--nav-height)); /* sobe pra trás do header blur */
    display: flex;
    align-items: flex-end;
    padding: 0 4% 50px;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    z-index: -1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    background: inset;
    background: linear-gradient(to top, var(--bg-darker) 0%, rgba(5,5,5,0.4) 50%, rgba(5,5,5,0.8) 100%);
}

.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.badge {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: inline-block;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 15px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.hero-desc {
    font-size: 1.05rem;
    color: #e5e5e5;
    margin-bottom: 25px;
    line-height: 1.5;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.btn {
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    font-family: var(--font-heading);
}

.btn-primary {
    background-color: white;
    color: black;
}
.btn-primary:hover {
    background-color: rgba(255,255,255,0.8);
}

.btn-primary i.fa-play {
    color: black;
}

.btn-glass {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
    backdrop-filter: blur(10px);
}
.btn-glass:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

/* Sliders de Módulos */
.modules-lists {
    padding: 20px 0;
    position: relative;
    z-index: 3;
    margin-top: -30px; /* Sobrepõe levemente o hero */
}

.slider-row {
    margin-bottom: 40px;
    padding-left: 4%;
}

.slider-header {
    margin-bottom: 15px;
    position: relative;
    z-index: 4;
}

.slider-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: #e5e5e5;
    display: inline-block;
    cursor: pointer;
    transition: color 0.2s;
}

.slider-title:hover {
    color: white;
}

.slider-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 15px;
    padding-bottom: 15px;
    padding-right: 4%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.slider-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for slider */
}

/* Card de Aula (Thumbnail) */
.class-card {
    flex: 0 0 calc(50% - 15px); /* Mobile: 2 cartas por tela aprox. */
    max-width: 320px;
    min-width: 140px;
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    scroll-snap-align: start;
    background-color: var(--bg-surface);
}

@media (min-width: 600px) {
    .class-card {
        flex: 0 0 calc(33.3% - 15px);
    }
}
@media (min-width: 900px) {
    .class-card {
        flex: 0 0 calc(20% - 15px);
    }
}

.class-card:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
    z-index: 10;
}

.card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    background-color: #111;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.card-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;
}

.class-card:hover .card-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.class-card:hover .play-icon {
    transform: scale(1);
}

.card-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.card-progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255,255,255,0.2);
    position: absolute;
    bottom: 0; left: 0;
}

.card-progress-fill {
    height: 100%;
    background-color: var(--primary-color);
}

.card-info {
    padding: 12px 10px;
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-dark) 100%);
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}
.card-status.done i {
    color: var(--primary-color);
}


/* -------------------------------------
 * VIEW 2: PLAYER 
 * ------------------------------------- */

.view-player {
    padding-top: var(--nav-height);
}

@media (min-width: 1024px) {
    .view-player {
        padding: calc(var(--nav-height) + 20px) 4% 0;
        max-width: 1200px;
        margin: 0 auto;
    }
}

.player-container {
    width: 100%;
    background: black;
}

@media (min-width: 1024px) {
    .player-container {
        border-radius: var(--radius-lg);
        overflow: hidden;
        box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    }
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    background: #000;
}

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

.video-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    color: var(--primary-color);
}

.player-details {
    padding: 20px 4%;
}

@media (min-width: 1024px) {
    .player-details {
        padding: 30px 0;
    }
}

.class-meta {
    margin-bottom: 20px;
}

.module-chip {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: inline-block;
}

.class-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.class-duration {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    background-color: var(--bg-surface);
    padding: 15px;
    border-radius: var(--radius-md);
    justify-content: center;
}

.control-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.control-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-mark-done.completed {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.class-description-box {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

/* Materiais */
.section-subtitle {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #e5e5e5;
}

.material-card {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    gap: 15px;
}

.material-icon {
    font-size: 1.8rem;
    color: #ef4444; /* PDF color */
}

.material-info {
    flex: 1;
}

.material-info h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.material-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.download-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 10px;
}

.download-btn:hover {
    color: var(--primary-color);
}

/* -------------------------------------
 * VIEW 3 & 4: PROGRESSO E MENU 
 * ------------------------------------- */
.view-progress, .view-menu {
    padding: var(--nav-height) 4% 0;
    max-width: 800px;
    margin: 0 auto;
}

.view-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin: 30px 0;
    color: var(--text-primary);
}

/* Progresso */
.progress-stats-box {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.stat-circle {
    width: 200px;
    height: 200px;
    position: relative;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: var(--bg-surface);
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke: var(--primary-color);
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out;
}

.percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-metrics {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.metric {
    background: var(--bg-surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    flex: 1;
    max-width: 200px;
    border: 1px solid var(--border-color);
}

.metric i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.metric h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

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

/* Menu */
.profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.profile-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.profile-info p {
    color: var(--text-secondary);
}

.menu-group {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.05rem;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: rgba(255,255,255,0.05);
}

.menu-item i {
    color: var(--text-muted);
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

.menu-logout {
    color: #ef4444;
}

.menu-logout i {
    color: #ef4444;
}

/* -------------------------------------
 * BOTTOM NAVIGATION (MOBILE / APP)
 * ------------------------------------- */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background-color: rgba(15,15,15,0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-bottom-nav);
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area */
}

/* Sidebar App-like no Desktop */
@media (min-width: 900px) {
    .bottom-nav {
        flex-direction: column;
        justify-content: center;
        gap: 40px;
        top: 0;
        left: 0;
        width: 80px;
        height: 100vh;
        border-top: none;
        border-right: 1px solid rgba(255,255,255,0.05);
        padding-bottom: 0;
    }
    
    .nav-item {
        width: 100%;
        padding: 10px 0;
    }

    .app-header {
        padding-left: calc(80px + 4%);
    }

    main {
        padding-left: 80px;
    }

    .hero-showcase {
        padding-left: calc(80px + 4%); 
    }

    .slider-row {
        padding-left: calc(80px + 4%);
    }
    
    .slider-container {
        padding-right: calc(80px + 4%);
    }
    
    .view-player {
        padding-left: calc(80px + 4%);
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: color 0.2s;
    width: 60px;
}

.nav-item i {
    font-size: 1.4rem;
}

.nav-item.active {
    color: white;
}

/* Responsive Hide Utilities */
@media (max-width: 600px) {
    .hide-mobile {
        display: none;
    }
}
