/* Definição do Tema e Cores Globais */
:root {
    --bg-main: #14141d; /* Chumbo profundo (Fundo) */
    --bg-panel: #1e1e2b; /* Chumbo intermediário (Sidebar/Header) */
    --accent-blue: #3b82f6; /* Azul energético */
    --accent-purple: #8b5cf6; /* Roxo vibrante */
    --gradient-primary: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    --text-light: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-light);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ======== SIDEBAR ======== */
.sidebar {
    width: 280px;
    background-color: var(--bg-panel);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
    border-right: 1px solid var(--border-color);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 1px solid var(--border-color);
}

.sidebar.collapsed .sidebar-logo span {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    gap: 8px;
}

.sidebar-nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
    font-size: 1.05rem;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.sidebar-nav a i {
    font-size: 1.25rem;
    min-width: 25px;
    text-align: center;
}

.sidebar.collapsed .sidebar-nav a span {
    display: none;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    color: var(--text-light);
    background: rgba(139, 92, 246, 0.1);
    border-left-color: var(--accent-purple);
}

.sidebar-nav a.active i {
    color: var(--accent-blue);
}

/* ======== ESTRUTURA PRINCIPAL ======== */
.main-wrapper {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    width: calc(100% - 280px);
}

.main-wrapper.expanded {
    margin-left: 80px;
    width: calc(100% - 80px);
}

/* ======== HEADER ======== */
.header {
    height: 80px;
    background-color: rgba(30, 30, 43, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 99;
    border-bottom: 1px solid var(--border-color);
}

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

.header-left h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--accent-blue);
}

.header-right .user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.xp-badge {
    background: var(--gradient-primary);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    cursor: pointer;
    transition: var(--transition);
}

.avatar:hover {
    transform: scale(1.05);
    border-color: var(--accent-purple);
}

/* ======== CONTEÚDO & GLASSMORPHISM ======== */
.content {
    flex: 1;
    padding: 32px;
}

.card-glass {
    background: rgba(30, 30, 43, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}

/* ======== DASHBOARD OVERVIEW & PROGRESSO ======== */
.dashboard-overview {
    margin-bottom: 40px;
}

.overview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.overview-text h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.overview-text strong {
    color: var(--accent-blue);
}

.progress-container {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 20px;
    box-shadow: 0 0 10px var(--accent-purple);
    transition: width 1s ease-in-out;
}

.progress-text {
    align-self: flex-end;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ======== MISSÕES (CURSOS) ======== */
.section-title {
    font-size: 1.25rem;
    margin-bottom: 24px;
    color: var(--text-light);
    border-left: 4px solid var(--accent-blue);
    padding-left: 12px;
}

.missions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.mission-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mission-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.3);
}

.mission-icon {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.mission-info h4 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.mission-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.mission-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.reward {
    color: #fbbf24; /* Dourado para XP */
}

.status.in-progress { color: var(--accent-blue); }
.status.not-started { color: var(--text-muted); }
.status.locked { color: #ef4444; }

/* Botões */
.btn-action {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
}

.btn-action:hover {
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transform: scale(1.02);
}

.btn-disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-disabled:hover {
    box-shadow: none;
    transform: none;
}

/* ======== FOOTER ======== */
.footer {
    padding: 24px 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* ======== RESPONSIVIDADE ======== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .main-wrapper, .main-wrapper.expanded {
        margin-left: 0;
        width: 100%;
    }
    .overview-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .progress-container {
        width: 100%;
        max-width: 100%;
    }
}