:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --accent: #f59e0b;
    --success: #10b981;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 3rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

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

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: #f1f5f9;
    color: var(--primary);
}

.nav-menu a i {
    font-size: 1.1rem;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.admin-link {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the icon */
    width: 40px;
    /* Fixed width for touch target */
    height: 40px;
    border-radius: 10px;
    /* Rounded square */
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    /* Slightly larger icon */
    transition: all 0.2s;
    margin: 0 auto;
    /* Center in the footer */
}

.admin-link:hover {
    color: var(--primary);
    background-color: #f1f5f9;
    /* Subtle hover background */
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem 3rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.search-bar {
    position: relative;
    width: 400px;
    display: none;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--primary);
}

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

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

.welcome-text span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.avatar-circle {
    width: 45px;
    height: 45px;
    background: #e0e7ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: var(--shadow);
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 24px;
    padding: 3rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
}

.hero-text h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-text p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    text-align: center;
    min-width: 120px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item strong {
    display: block;
    font-size: 2rem;
    font-weight: 800;
}

.stat-item span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Modules Grid */
.section-title {
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.section-title p {
    color: var(--text-muted);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.module-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.module-image {
    width: 100%;
    height: 160px;
    background: #f1f5f9;
    position: relative;
}

.module-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.module-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.badge-unlocked {
    background: #dcfce7;
    color: #166534;
}

.badge-locked {
    background: #fee2e2;
    color: #991b1b;
}

.module-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.module-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.module-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.module-btn {
    margin-top: auto;
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-unlocked {
    background: var(--primary);
    color: white;
}

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

.btn-locked {
    background: #f1f5f9;
    color: var(--text-muted);
}

.btn-locked:hover {
    background: #e2e8f0;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.lock-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    box-shadow: var(--shadow);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem;
}

.header-menu-btn {
    background: var(--brown);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-logo-text {
    color: var(--brown);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
        align-items: center;
    }

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

    .logo-container span,
    .nav-menu a span,
    .welcome-text,
    .admin-link span {
        display: none;
    }

    .main-content {
        margin-left: 80px;
        padding: 2rem;
    }

    .hero-banner {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        align-items: center;
    }

    .hero-text {
        text-align: center;
    }

    .hero-stats {
        width: 100%;
        justify-content: center;
    }
}

.mobile-close-btn {
    display: none;
}

@media (max-width: 768px) {
    .mobile-close-btn {
        display: block !important;
    }

    .app-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 260px;
        /* Restore PC width */
        height: 100vh;
        position: fixed;
        left: 0;
        top: 0;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        border-right: 1px solid var(--border);
        z-index: 1000;
    }

    .mobile-menu-btn {
        display: none !important;
    }

    .logo-container {
        margin-bottom: 3rem;
    }

    .nav-menu {
        display: flex !important;
        position: static;
        width: 100%;
        background: transparent;
        box-shadow: none;
        padding: 0;
        border-bottom: none;
    }

    .nav-menu a {
        padding: 0.85rem 1rem;
        justify-content: flex-start;
    }

    .logo-container span,
    .nav-menu a span,
    .admin-link span {
        display: inline !important;
    }

    .sidebar-footer {
        display: block;
        width: 100%;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .top-header {
        display: flex !important;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: var(--brown);
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
        padding: 0.8rem 1.5rem;
        width: calc(100% + 3rem);
        border-radius: 0;
    }

    .header-logo-text {
        color: #ffffff;
    }


    .hero-banner {
        padding: 1.5rem;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    .info-box {
        flex-direction: column;
        padding: 1rem;
    }
}

/* Info Box Styles */
.info-box {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
}

.info-item i {
    margin-top: 0.2rem;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .info-box {
        padding: 1rem;
    }
}

/* PARTE 5 - CSS COMPLETO (Personalizado MembersPro) */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,700;0,9..144,900;1,9..144,500&family=DM+Sans:wght@400;500;600&display=swap');

:root {
    --cream: #FDF6EC;
    --warm: #F5E6C8;
    --orange: #E8622A;
    --orange-d: #C44E1F;
    --brown: #3D2010;
    --brown-mid: #6B3A1F;
    --green: #4A7C59;
    --green-l: #E8F2EB;
    --gold: #D4A043;
}

body,
p,
span,
li,
a,
button,
input,
textarea {
    font-family: 'DM Sans', sans-serif !important;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: 'Fraunces', serif !important;
}

/* background geral */
.main-content,
.content-wrapper,
.page-content,
main,
.dashboard-content {
    background-color: var(--cream) !important;
}

/* sidebar */
.sidebar,
.side-menu,
nav.sidebar,
.left-menu {
    background-color: var(--brown) !important;
}

.sidebar a,
.side-menu a,
.nav-link,
.menu-item {
    color: rgba(255, 255, 255, 0.6) !important;
    border-radius: 9px !important;
    transition: all 0.15s !important;
}

.sidebar a:hover,
.nav-link:hover,
.menu-item:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #fff !important;
}

.sidebar a.active,
.nav-link.active,
.menu-item.active {
    background: var(--orange) !important;
    color: #fff !important;
}

/* hero/banner de boas-vindas */
.welcome-section,
.hero-section,
.banner-section,
[class*="welcome-banner"],
[class*="hero-banner"] {
    background: var(--brown) !important;
    position: relative !important;
    overflow: hidden !important;
    padding: 28px !important;
}

.welcome-section h1,
.welcome-section h2,
.hero-section h1,
[class*="welcome-banner"] h1 {
    font-family: 'Fraunces', serif !important;
    color: #fff !important;
    font-size: clamp(20px, 3vw, 28px) !important;
    line-height: 1.2 !important;
}

.welcome-section p,
.hero-section p,
[class*="welcome-banner"] p {
    color: rgba(255, 255, 255, 0.65) !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

/* cards de módulo */
.module-card,
.course-card,
.product-card,
[class*="module-item"],
[class*="lesson-card"] {
    background: #fff !important;
    border: 1.5px solid var(--warm) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.module-card:hover,
.course-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 40px rgba(61, 32, 16, 0.09) !important;
}

/* card liberado — destaque laranja */
.module-card.unlocked,
.module-card.available,
.course-card.active,
[class*="module-item"].unlocked {
    border-color: var(--orange) !important;
    border-width: 2px !important;
    box-shadow: 0 4px 24px rgba(232, 98, 42, 0.12) !important;
}

/* títulos dos cards */
.module-card h3,
.module-card h4,
.module-card .title,
.course-card h3,
.course-card .title {
    font-family: 'Fraunces', serif !important;
    color: var(--brown) !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
}

/* botão principal (produto liberado) */
.btn-primary,
.btn-access,
[class*="btn-primary"],
.module-card .btn,
.course-card .btn-main {
    background: var(--orange) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 11px 16px !important;
    min-height: 44px !important;
    width: 100% !important;
    transition: background 0.15s !important;
}

.btn-primary:hover,
.btn-access:hover {
    background: var(--orange-d) !important;
}

/* botão secundário (produto bloqueado) */
.btn-secondary,
.btn-locked,
[class*="btn-secondary"] {
    background: var(--warm) !important;
    color: var(--brown-mid) !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 11px 16px !important;
    min-height: 44px !important;
    width: 100% !important;
}

.btn-secondary:hover {
    background: #ead9b0 !important;
}

/* badge liberado */
.badge-unlocked,
.badge-active,
[class*="badge"].free {
    background: var(--green) !important;
    color: #fff !important;
    border-radius: 100px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
}

/* badge bloqueado */
.badge-locked,
[class*="badge"].locked {
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    border-radius: 100px !important;
    backdrop-filter: blur(4px) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
}

/* grid de módulos */
.modules-grid,
.courses-grid,
[class*="module-grid"] {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 16px !important;
}

/* scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--cream);
}

::-webkit-scrollbar-thumb {
    background: var(--warm);
    border-radius: 10px;
}

/* ── MOBILE ── */
@media (max-width: 768px) {

    .modules-grid,
    .courses-grid,
    [class*="module-grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .welcome-section,
    .hero-section {
        padding: 20px 16px !important;
    }

    .main-content,
    .content-wrapper,
    .page-content {
        padding: 16px !important;
    }

    .btn-primary,
    .btn-secondary,
    .btn-access {
        min-height: 48px !important;
        font-size: 14px !important;
    }
}

/* Custom Sidebar Toggle Logic (All Devices) */
.sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.menu-closed .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
}

@media (min-width: 769px) {
    body.menu-closed .main-content {
        margin-left: 0 !important;
    }
}