@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@300;400;500;700&display=swap');

:root {

    --primary: #6366f1;
    --primary-alt: #4f46e5;
    --secondary: #d946ef;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;


    --bg-dark: #020617;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-glass: rgba(30, 41, 59, 0.4);


    --border-light: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.2);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);


    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

/* ===== LIGHT MODE ===== */
html[data-theme='light'] {
    --bg-dark: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-glass: rgba(226, 232, 240, 0.6);
    --border-light: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(99, 102, 241, 0.25);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

html[data-theme='light'] body {
    background-image:
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(217, 70, 239, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(241, 245, 249, 1) 0%, transparent 100%);
}

html[data-theme='light'] header {
    background: rgba(241, 245, 249, 0.85);
}

html[data-theme='light'] .navbar-brand {
    background: linear-gradient(135deg, #0f172a 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    cursor: pointer;
    padding: 0.4rem 0.9rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.theme-toggle:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}



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

body {
    background: var(--bg-dark);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(217, 70, 239, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 1) 0%, transparent 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

header {
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 2000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

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

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.breadcrumb-container {
    padding: 1.5rem 0;
}

.breadcrumb {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-item+.breadcrumb-item::before {
    content: '/';
    margin-right: 0.75rem;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-premium);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-premium), var(--shadow-glow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-item {
    padding: 1.75rem;
    text-align: left;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    display: block;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-value.text-primary {
    color: var(--primary);
}

.stat-value.text-secondary {
    color: var(--secondary);
}

.stat-value.text-accent {
    color: var(--accent);
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.course-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.profile-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-badge {
    padding: 0.35rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.course-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.course-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.progress-container {
    margin-top: auto;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.progress-track {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 99px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    gap: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-alt) 100%);
    color: white;
    box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 12px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.profile-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
}

.avatar-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 40px;
    object-fit: cover;
    border: 4px solid var(--bg-dark);
    box-shadow: var(--shadow-premium);
}

.avatar-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50px;
    border: 2px solid var(--primary);
    opacity: 0.3;
    animation: pulse 4s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.profile-info h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.profile-email {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.activity-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-meta {
    display: flex;
    flex-direction: column;
}

.activity-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

footer {
    margin-top: 20px;
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 99px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== TABLET (max 992px) ===== */
@media (max-width: 992px) {
    .course-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    /* --- Navbar & Hamburger --- */
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 75vw;
        max-width: 320px;
        height: 100vh;
        background: var(--bg-card);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-left: 1px solid var(--border-light);
        padding: 6rem 2rem 2rem;
        gap: 0.5rem;
        list-style: none;
        z-index: 2100;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -20px 0 40px rgba(0, 0, 0, 0.3);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-link {
        display: block;
        font-size: 1.1rem;
        padding: 0.85rem 1rem;
        border-radius: 12px;
        transition: background 0.2s, color 0.2s;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(99, 102, 241, 0.1);
        color: var(--primary);
    }

    .nav-link::after {
        display: none;
    }

    /* Overlay when menu is open */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
    }

    .nav-overlay.open {
        display: block;
    }


    /* --- Typography --- */
    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    .navbar-brand {
        font-size: 1.4rem;
    }

    /* --- Layout --- */
    .container {
        padding: 0 1rem;
    }

    .py-4 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    /* --- Stats Grid --- */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    /* --- Course Grid --- */
    .course-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* --- Glass Card --- */
    .glass-card {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .glass-card:hover {
        transform: none;
    }

    /* --- Buttons --- */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    /* --- Tables (Courses page Catalog) --- */
    #course-table-body tr {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 2rem;
        margin-bottom: 1.5rem;
        background: var(--bg-glass);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--border-light);
        border-radius: 24px;
        position: relative;
        box-shadow: var(--shadow-premium);
    }

    #course-table-body td {
        display: block;
        padding: 0;
        border: none;
        width: 100%;
        white-space: normal;
    }

    #course-table-body td:last-child {
        margin-top: 1rem;
        text-align: left !important;
        padding-right: 0 !important;
    }

    #course-table-body td:last-child .btn {
        width: 100%;
    }

    table thead {
        display: none;
    }

    .glass-card table {
        display: block;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .glass-card:has(#course-table-body) {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .glass-card[style*="overflow: hidden"] {
        overflow-x: hidden !important;
    }

    /* --- Course Detail (Courses.html) --- */
    .course-details-grid {
        display: flex !important;
        flex-direction: column-reverse;
        gap: 1.5rem;
    }

    #lesson-list {
        max-height: 400px;
        overflow-y: auto;
        padding-right: 0.5rem;
        margin-right: -0.5rem;
    }

    /* Lesson items more compact on mobile */
    .lesson-item {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem;
    }

    .lesson-item button {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8rem !important;
    }

    /* Unstick the sidebar in mobile */
    div[style*="position: sticky"] {
        position: relative !important;
        top: auto !important;
    }

    /* Ensure table is scrollable */
    .glass-card[style*="overflow: hidden"] {
        overflow-x: auto !important;
    }

    /* --- Profile --- */
    .profile-hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .avatar-wrapper {
        margin: 0 auto;
        width: 150px;
        height: 150px;
    }

    .profile-info h1 {
        font-size: 2rem !important;
    }

    .activity-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* --- Profile Page Grid --- */
    .profile-content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* --- Stat values --- */
    .stat-value {
        font-size: 1.75rem;
    }

    /* --- Breadcrumb --- */
    .breadcrumb-container {
        padding: 0.75rem 0;
    }

    /* --- Footer --- */
    footer {
        padding: 2rem 0;
    }
}

/* ===== SMALL MOBILE (max 480px) ===== */
@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem !important;
    }

    .navbar {
        padding: 1rem 0;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .glass-card {
        padding: 1rem;
        border-radius: 14px;
    }

    .btn-primary,
    .btn-outline {
        width: 100%;
        text-align: center;
    }

    .course-title {
        font-size: 1.2rem;
    }
}