:root {
    --bg-dark: #0a0b10;
    --bg-card: rgba(30, 32, 45, 0.7);
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

h1,
h2,
h3,
.badge {
    font-family: 'Outfit', sans-serif;
}

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
}

/* Sidebar Styling */
.logo-container {
    padding: 1rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.3rem;
    color: var(--accent);
    font-weight: 800;
    opacity: 0.8;
}

#main-logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

#main-logo:hover {
    transform: scale(1.05);
}

.sidebar {
    background: rgba(15, 17, 26, 0.95);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.logo {
    margin-bottom: 3rem;
}

.badge {
    background: var(--gradient);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo h1 {
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

.logo h1 span {
    color: var(--accent);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dim);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.icon {
    display: inline-block;
    width: 18px;
    height: 12px;
    background: var(--accent);
    transform: skew(-20deg);
    flex-shrink: 0;
}

.nav-item.completed .icon {
    background: #10b981;
}

/* Custom Scrollbar */
.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.progress-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: var(--text-dim);
}

.progress-bar {
    height: 6px;
    background: #1e293b;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.5s ease;
}

/* Main Content */
.main-content {
    padding: 2rem 3rem;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.1), transparent 40%);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.top-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.top-header p {
    color: var(--text-dim);
}

.btn {
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.reading-area {
    max-width: 900px;
    margin: 0 auto;
}

.content-card {
    min-height: calc(100vh - 200px);
}

.study-view {
    padding: 1rem;
    line-height: 1.8;
    color: #e2e8f0;
}

.study-view h3 {
    color: var(--accent);
    margin: 2rem 0 1rem;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.study-view h4 {
    color: var(--primary-light);
    margin: 1.5rem 0 0.8rem;
    font-size: 1.3rem;
}

.study-view p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.study-view ul,
.study-view ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.study-view li {
    margin-bottom: 0.8rem;
}

.study-view b,
.study-view strong {
    color: var(--accent);
    font-weight: 700;
}

.highlight-box {
    background: rgba(79, 70, 229, 0.1);
    border-left: 4px solid var(--primary);
    padding: 1.2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.welcome-screen {
    text-align: center;
    padding-top: 5rem;
}

.welcome-screen h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.accordion-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.accordion-header {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.accordion-header.active {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    border-bottom: 1px solid var(--border);
}

.accordion-header .arrow {
    transition: transform 0.3s ease;
}

.accordion-header.active .arrow {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
}

.accordion-body.open {
    max-height: 2000px;
    /* Large enough to fit content */
    padding: 1.5rem;
}

/* Responsividade */
.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 1.5rem;
    }

    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .top-header h2 {
        font-size: 1.5rem;
    }

    .btn-icon {
        display: block;
        margin-bottom: 1rem;
    }

    .subject-info {
        display: flex;
        flex-direction: column;
    }

    .actions {
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    /* Overlay para fechar o menu ao clicar fora */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
    }

    .sidebar-overlay.open {
        display: block;
    }
}