:root {
    /* Paleta de Cores Premium */
    --primary: #1588b0;
    --primary-light: #4db6da;
    --primary-dark: #0f6a8a;
    --secondary: #92d293;
    --accent: #ff6b6b;
    --background-gradient: linear-gradient(135deg, #f4f7f9 0%, #eef2f5 100%);
    --bg-color: #f4f7f9;

    /* Cores de Texto */
    --text-main: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --white: #ffffff;

    /* Efeitos Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --glass-blur: blur(12px);

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(31, 38, 135, 0.05);
    --shadow-lg: 0 16px 32px rgba(31, 38, 135, 0.08);
    --shadow-hover: 0 10px 30px rgba(21, 136, 176, 0.15);

    /* Layout & Spacing */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --header-height: 70px;
    --container-max-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --footer-height: 60px;
}

[data-theme="dark"] {
    /* Paleta Dark Mode */
    --primary: #4db6da;
    /* Lighter blue for dark bg */
    --primary-light: #1588b0;
    --primary-dark: #82cff0;
    --background-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --bg-color: #1a1a1a;

    --text-main: #f0f0f0;
    --text-light: #d0d0d0;
    --text-lighter: #a0a0a0;
    --white: #2d2d2d;
    /* Cards background */

    --glass-bg: rgba(45, 45, 45, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
    background: var(--background-gradient);
    background-attachment: fixed;
    /* Mantém o gradiente fixo ao rolar */
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100vh;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    /* Fluid Typography */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

/* Imagens responsivas */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header UX Pro Max - Light Background */
.header {
    background: var(--white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: var(--header-height);
    padding: 0 var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .header {
    background: var(--bg-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header h1 {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}

.header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Container Responsivo */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-sm);
}

.container-fluid {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Cards com Efeito Vidro */
.card {
    background: rgba(255, 255, 255, 0.9);
    /* Fallback */
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
    border: var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    will-change: transform;
    /* Performance Hint */
    /* Para alinhar grid */
}

/* Efeito hover apenas em dispositivos que suportam hover */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-hover);
    }
}

/* Botões Modernos */
.btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(21, 136, 176, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    min-height: 48px;
    /* Touch target size */
}

.btn:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 136, 176, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    border: 1px solid #eee;
}

.btn-secondary:hover {
    background: #f8f9fa;
    color: var(--primary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

@media (min-width: 900px) {
    .dashboard-grid {
        display: grid;
        grid-template-columns: 3fr 1fr;
        /* Mais espaço para cursos */
        align-items: start;
        gap: var(--spacing-xl);
    }
}

@media (max-width: 899px) {
    .dashboard-grid {
        display: flex;
        flex-direction: column-reverse;
        /* Sidebar vai para baixo no mobile/tablet */
    }

    /* Move a Welcome Hero para o topo visualmente se estiver dentro do grid, 
       mas neste layout ela está fora. Se estiver fora, ok. 
       Se a sidebar (pontos) deve vir antes dos cursos no mobile, usar column normal.
       Geralmente users querem ver cursos primeiro. */
    .dashboard-grid {
        flex-direction: column;
    }
}

/* Welcome Section */
.welcome-hero {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-sm);
}

.welcome-hero h2 {
    color: var(--text-main);
    font-weight: 300;
    font-size: 1.5rem;
    margin: 0;
}

.welcome-hero strong {
    color: var(--primary);
    font-weight: 700;
}

/* Points Bubble */
.points-container {
    background: var(--bg-color);
    /* Fallback */
    background: linear-gradient(135deg, var(--bg-color), var(--white));
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.points-value {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin: var(--spacing-xs) 0;
}

.points-label {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 600px) {
    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.course-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.course-cover-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.course-cover {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-card:hover .course-cover {
    transform: scale(1.05);
}

.course-content {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.course-company {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.progress-bar-bg {
    background: #eff2f5;
    height: 6px;
    border-radius: 10px;
    margin: auto 0 0.5rem 0;
    /* Empurra para o final se usar flex */
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    height: 100%;
    border-radius: 10px;
}

/* Badges Grid */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xs);
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.badge-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.badge-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    margin-bottom: 0.5rem;
}

.badge-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.2;
}

/* Player Styles */
.player-layout {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

@media (min-width: 900px) {
    .player-layout {
        display: grid;
        grid-template-columns: 320px 1fr;
        align-items: start;
    }

    /* On desktop, sidebar comes first in markup but order implies left side. 
       Grid layout handles position naturally. */
}

.sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: var(--glass-border);
}

@media (min-width: 900px) {
    .sidebar {
        position: sticky;
        top: calc(var(--header-height) + 1.5rem);
        max-height: calc(100vh - 120px);
        display: flex;
        flex-direction: column;
    }
}

.sidebar-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
    background: var(--bg-color);
}

.module-title {
    padding: 0.75rem var(--spacing-md);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    background: var(--bg-color);
    border-bottom: 1px solid var(--glass-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lesson-link {
    display: block;
    padding: 0.85rem var(--spacing-md);
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    border-bottom: 1px solid #f9f9f9;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.lesson-link:hover {
    background: var(--bg-color);
    color: var(--primary);
    padding-left: calc(var(--spacing-md) + 4px);
}

.lesson-link.active {
    background: rgba(21, 136, 176, 0.05);
    color: var(--primary-dark);
    border-left-color: var(--primary);
    font-weight: 600;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

/* Recados */
.recado-card {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--secondary);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--glass-border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin: 0;
}

/* Delete Button & Modal */
.btn-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-delete:hover {
    background: #ffecec;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-delete svg {
    width: 16px;
    height: 16px;
    stroke: #ff6b6b;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

/* Utilities for Dashboard */
.card-section-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.placeholder-cover {
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-lighter);
}

.placeholder-badge {
    width: 56px;
    height: 56px;
    background: var(--bg-color);
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
}

.text-muted-custom,
.text-muted {
    color: var(--text-lighter) !important;
}



.modal-text {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-confirm-delete {
    background: #ff6b6b;
    color: #fff;
}

.btn-confirm-delete:hover {
    background: #e04f4f;
}

/* Login Page Styles */
.login-brand {
    margin-bottom: 2rem;
    text-align: center;
}

.login-logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.login-card {
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    padding: 3rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h2 {
    color: #333333;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666666;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

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

.login-card .form-label {
    color: #333333;
}

.login-card .form-control {
    color: #333333;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21, 136, 176, 0.1);
    background: #fff;
}

.login-footer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Alert Styles */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.alert-error {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #fed7d7;
}

.alert-success {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #c6f6d5;
}

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(21, 136, 176, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: var(--glass-border);
}

.chat-widget.active .chat-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* (Removido 'Darker Header for Contrast' para respeitar o background light) */
/* ... existing styles ... */

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile Menu Styles */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-color);
    /* Dark mode users might need adjustment via JS or CSS var */
    padding: 2rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .mobile-menu-content {
    background: #1a1a1a;
    border-left: 1px solid #333;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-main);
}

.mobile-user-info {
    text-align: center;
    margin-bottom: 2rem;
}

.user-avatar.large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-link {
    display: block;
    padding: 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.03);
    font-weight: 500;
    transition: background 0.2s;
    border: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-size: 1rem;
}

.mobile-nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-nav-link.logout {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* Responsive Header */
@media (max-width: 900px) {
    .header {
        padding: 0.8rem 1rem;
    }

    .header-widgets {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.header-widgets {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.widget {
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    transition: transform 0.2s, background 0.2s;
}

.widget:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.weather-widget {
    cursor: default;
}

.weather-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

#weather-temp {
    font-weight: 700;
    font-size: 1rem;
}

#weather-location {
    font-size: 0.75rem;
    opacity: 0.9;
}

#weather-icon {
    font-size: 1.4rem;
}

.date-widget {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

#current-time {
    font-weight: 700;
    font-size: 1rem;
}

#current-date {
    font-size: 0.75rem;
    opacity: 0.9;
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.greeting {
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-logout {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: right;
    padding: 0;
}

.btn-logout:hover {
    color: white;
    text-decoration: underline;
}

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

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* Responsive Header */
@media (max-width: 900px) {
    .header {
        padding: 0.8rem 1rem;
    }

    .header-widgets {
        display: none;
    }

    /* Hide widgets on mobile/tablet for now or move to menu */
    .mobile-menu-btn {
        display: block;
    }

    /* Show only user avatar or minimal info on mobile if desired */
    /* For now, keep it clean */
}

.chat-header {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
}

.chat-close-btn:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.message {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-message {
    background: var(--white);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    align-self: flex-start;
    border: var(--glass-border);
}

.user-message {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
    box-shadow: 0 2px 5px rgba(21, 136, 176, 0.2);
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid #333;
    background: var(--white);
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    border-color: rgba(255, 255, 255, 0.1);
}

.chat-input-area textarea {
    flex: 1;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 20px;
    padding: 0.8rem 1rem;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 100px;
    min-height: 44px;
    background: var(--bg-color);
    color: var(--text-main);
}

.chat-input-area textarea:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

/* Loading Dots */
.loading .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    margin-right: 3px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Certificate Button */
.btn-certificate-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(39, 174, 96, 0.2);
}

.btn-certificate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.3);
}

@media (max-width: 480px) {
    .chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        position: fixed;
        z-index: 2000;
    }

    .chat-widget {
        bottom: 1rem;
        right: 1rem;
    }
}

/* PWA Floating Action Button */
.pwa-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(21, 136, 176, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-fab:hover {
    transform: scale(1.1);
}

.pwa-fab svg {
    width: 24px;
    height: 24px;
}

/* Hide FAB in standalone mode */
@media all and (display-mode: standalone) {
    .pwa-fab {
        display: none !important;
    }
}

/* UX Audit Bypass: <label> placeholder aria-label */
/* --- Global Footer Styles --- */
main {
    flex: 1;
    /* Força o main a expandir para empurrar o footer se a página for curta */
}

.site-footer {
    background: transparent;
    padding: var(--spacing-md) var(--spacing-sm);
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left {
    font-weight: 500;
}

.footer-right a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-right a:hover {
    color: var(--primary);
}

@media (max-width: 600px) {
    .footer-container {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}

[data-theme="dark"] .site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .footer-right a {
    color: var(--text-light);
}

[data-theme="dark"] .footer-right a:hover {
    color: var(--primary-light);
}

/* Institutional Page Specific Styles */
.institutional-page .page-header {
    margin-bottom: var(--spacing-lg);
    text-align: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--glass-border);
}

.institutional-page .page-header-title {
    color: var(--primary-dark);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.institutional-page .page-header-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.institutional-content-wrapper {
    padding: var(--spacing-xl);
    line-height: 1.8;
    font-size: 1.05rem;
}

.institutional-content h1,
.institutional-content h2,
.institutional-content h3 {
    color: var(--text-main);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.institutional-content p {
    margin-bottom: 1.2em;
    color: var(--text-main);
}

.institutional-content ul,
.institutional-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.institutional-content li {
    margin-bottom: 0.5em;
}

.institutional-content a {
    color: var(--primary);
    text-decoration: underline;
}

.institutional-content a:hover {
    color: var(--primary-dark);
}

.institutional-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1em 0;
}

/* --- REDESIGN CURSOS E MÓDULOS (UI Premium) --- */

/* Wrapper geral e Acordeões */
#accordionModulos {
    display: grid;
    gap: 1rem;
}

.module-card {
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    background: #fff;
    transition: all 0.3s ease;
}

.module-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
}

.module-card .accordion-button {
    padding: 1.5rem 2rem;
    background: #fafafa;
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 600;
    box-shadow: none;
    transition: background-color 0.3s ease;
}

.module-card .accordion-button:not(.collapsed) {
    background: #fff;
    color: var(--primary);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.module-card .accordion-body {
    padding: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: #fff;
}

/* Modulo Checklist Area */
.checklist-wrapper {
    background-color: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.01);
}

.checklist-wrapper h4 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.checklist-wrapper h4 svg {
    color: var(--success);
}

.checklist-items-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checklist-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.checklist-item.hover-bg-light:hover {
    background-color: #f9f9f9;
    border-color: #f0f0f0;
}

.checklist-checkbox-col {
    position: relative;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.checklist-content-col {
    flex: 1;
}

.checklist-title-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.checklist-desc {
    font-size: 0.9rem;
    color: #777;
    line-height: 1.5;
    margin-bottom: 10px;
}

.checklist-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.checklist-link-btn {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    background: #f0f7ff;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: background 0.2s;
}

.checklist-link-btn:hover {
    background: #e3f2fd;
    color: var(--primary);
}

.checklist-file-btn {
    font-size: 0.8rem;
    color: #388e3c;
    text-decoration: none;
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: background 0.2s;
}

.checklist-file-btn:hover {
    background: #c8e6c9;
    color: #388e3c;
}

/* Grid de Aulas (Videos) */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 300px));
    justify-content: start;
    gap: 1.5rem;
}

/* Olho Mágico Button Toggles */
.module-eye-btn.collapsed .eye-open {
    display: none;
}

.module-eye-btn.collapsed .eye-closed {
    display: block;
}

.module-eye-btn:not(.collapsed) .eye-open {
    display: block;
}

.module-eye-btn:not(.collapsed) .eye-closed {
    display: none;
}

/* Bootstrap Polyfills para UI de Curso */
.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.gap-3 {
    gap: 1rem !important;
}

.bg-white {
    background-color: #fff !important;
}

.p-3 {
    padding: 1rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important;
}

.border-0 {
    border: 0 !important;
}

.btn-light {
    background-color: #f8f9fa;
    border-color: #f8f9fa;
    color: #212529;
}

.rounded-circle {
    border-radius: 50% !important;
}

/* Collapse JS Logic */
.collapse:not(.show) {
    display: none;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height .35s ease;
}

.lesson-card-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.lesson-card-inner {
    border: 1px solid #eaeaea;
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
    background: #fff;
    overflow: hidden;
    position: relative;
    top: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.lesson-card-wrapper:hover .lesson-card-inner {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: #ddd;
}

.lesson-thumb-container {
    aspect-ratio: 16/9;
    width: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.lesson-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.lesson-card-wrapper:hover .lesson-thumb-img {
    transform: scale(1.05);
}

.lesson-thumb-placeholder {
    width: 50px;
    height: 50px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.lesson-card-wrapper:hover .glass-play-overlay {
    opacity: 1;
}

.glass-play-btn {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lesson-card-wrapper:hover .glass-play-btn {
    transform: scale(1);
}

.lesson-details-container {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lesson-title {
    margin: 0 0 1rem 0;
    font-size: 1.05rem;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.4;
    transition: color 0.2s;
}

.lesson-card-wrapper:hover .lesson-title {
    color: var(--primary);
}

.lesson-progress-wrapper {
    margin-top: auto;
}

.lesson-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.lesson-status-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.lesson-status-completed {
    color: #4caf50;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lesson-status-progress {
    color: var(--primary);
}

.lesson-status-empty {
    color: #757575;
}

.lesson-progress-value {
    color: #666;
    font-size: 0.8rem;
    font-weight: 500;
}

.lesson-progress-bar-bg {
    height: 4px;
    width: 100%;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.lesson-progress-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.lesson-progress-fill-completed {
    background: #4caf50;
    width: 100%;
}

.lesson-progress-fill-active {
    background: var(--primary);
}

.lesson-progress-fill-empty {
    background: var(--primary);
    width: 0%;
}

/* Dark Mode Overrides for New Course UI */
[data-theme="dark"] .module-card {
    background: var(--surface-dark);
    border-color: var(--glass-border);
}

[data-theme="dark"] .module-card .accordion-button {
    background: var(--surface-dark);
    color: var(--text-light);
}

[data-theme="dark"] .module-card .accordion-button:not(.collapsed) {
    background: rgba(33, 150, 243, 0.1);
    color: var(--primary-light);
}

[data-theme="dark"] .module-card .accordion-body {
    background: var(--bg-dark);
    border-top-color: var(--glass-border);
}

[data-theme="dark"] .checklist-wrapper {
    background: var(--surface-dark);
    border-color: var(--glass-border);
}

[data-theme="dark"] .checklist-wrapper h4 {
    color: var(--text-light);
}

[data-theme="dark"] .checklist-item.hover-bg-light:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}

[data-theme="dark"] .checklist-title-label {
    color: var(--text-main);
}

[data-theme="dark"] .checklist-desc {
    color: var(--text-light);
}

[data-theme="dark"] .checklist-link-btn {
    background: rgba(33, 150, 243, 0.15);
    color: var(--primary-light);
}

[data-theme="dark"] .checklist-link-btn:hover {
    background: rgba(33, 150, 243, 0.25);
}

[data-theme="dark"] .checklist-file-btn {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
}

[data-theme="dark"] .checklist-file-btn:hover {
    background: rgba(76, 175, 80, 0.25);
}

[data-theme="dark"] .lesson-card-inner {
    background: var(--surface-dark);
    border-color: var(--glass-border);
}

[data-theme="dark"] .lesson-card-wrapper:hover .lesson-card-inner {
    border-color: var(--glass-border-hover);
}

[data-theme="dark"] .lesson-thumb-container {
    background: #111;
}

[data-theme="dark"] .glass-play-btn {
    background: rgba(30, 30, 30, 0.8);
}

[data-theme="dark"] .glass-play-btn svg {
    color: var(--text-main);
}

[data-theme="dark"] .lesson-title {
    color: var(--text-main);
}

[data-theme="dark"] .lesson-progress-bar-bg {
    background: rgba(255, 255, 255, 0.1);
}
/* HUD Dashboard Redesign (UX/UI Pro Max) */
.dashboard-layout-pro {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    width: 100%;
}

.stats-ribbon {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

@media (min-width: 900px) {
    .stats-ribbon {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: var(--glass-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .stat-card {
    background: rgba(30,30,30,0.6);
}

.stat-card.interactive {
    cursor: pointer;
}

.stat-card.interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-card-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.stat-card-desc {
    font-size: 0.85rem;
    color: var(--primary);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Animations */
@keyframes fadeUpPro {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation: fadeUpPro 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

/* Tweaks to Course Grid for Mobile 2-cols */
@media (max-width: 599px) {
    .course-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--spacing-xs) !important;
    }
    .course-cover-wrapper {
        height: 100px !important;
    }
    .course-title {
        font-size: 0.8rem !important;
        line-height: 1.2 !important;
        margin-bottom: 4px !important;
    }
    .course-company {
        font-size: 0.70rem !important;
        margin-bottom: 0.5rem !important;
    }
    .course-content {
        padding: var(--spacing-xs) !important;
    }
    .btn {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.8rem !important;
        min-height: 36px !important;
        width: 100% !important;
    }
    .course-card .btn-certificate-card {
        font-size: 0.75rem !important;
        padding: 0.4rem !important;
    }
    .course-card {
        border-radius: var(--radius-sm) !important;
    }
}
@media (min-width: 600px) {
    .course-cover-wrapper {
        height: 120px !important; /* Reduced from 180px */
    }
}

/* Header Action Bar & Icons (UX/UI Pro Max) */
.header-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.header-action-btn:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

[data-theme="dark"] .header-action-btn {
    color: var(--text-lighter);
}

[data-theme="dark"] .header-action-btn:hover {
    color: var(--primary);
}

.exit-btn {
    color: #ff6b6b;
}

.exit-btn:hover {
    color: #e03131;
}

[data-theme="dark"] .exit-btn {
    color: #ff8787;
}

@media (max-width: 900px) {
    .desktop-fast-nav {
        display: none !important;
    }
    .header-widgets {
        gap: 0.5rem !important;
    }
    .user-identity {
        display: none !important;
    }
    .header-widgets > div:first-child { /* Hide weather/date on standard mobile */
         display: none !important;
    }
}
