/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%);
    --secondary-color: #1e293b;
    --accent-color: #f472b6;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.grid {
    display: grid;
}

/* Header */
.main-header {
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu ul {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.nav-menu a.active {
    color: var(--primary-color);
    border: solid 2px var(--primary-color);
    padding: 0.5rem 9px;
    border-radius: 9px;
    background: rgba(79, 70, 229, 0.1);
    font-weight: bold;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
    display: none;
    /* Hide the underline when using border */
}

.nav-menu a:hover::after {
    width: 100%;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

/* Secondary Menu (Languages) - W3Schools style */
.lang-bar {
    background: #282A35; /* Exact W3Schools dark background */
    color: white;
    padding: 0;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 48px;
    user-select: none;
    z-index: 99;
}

.lang-nav-container {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 100%;
    padding: 0;
    height: 100%;
}

.lang-menu {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    height: 100%;
    width: 100%;
}

.lang-menu::-webkit-scrollbar {
    display: none;
}

.lang-menu a {
    color: #fff;
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
    padding: 0 15px;
    height: 48px;
    line-height: 48px;
    display: inline-block;
    transition: background-color 0.2s, color 0.2s;
}

.lang-menu a:hover {
    background-color: #000;
    color: #fff;
}

.lang-menu a.active-course {
    background-color: #04AA6D !important; /* W3Schools Green */
    color: white !important;
    font-weight: 500;
}

.scroll-btn {
    position: absolute;
    top: 0;
    height: 100%;
    width: 40px;
    background: #282A35;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 16px;
    transition: background-color 0.2s;
}

.scroll-btn:hover {
    background-color: #000;
}

.scroll-btn.left {
    left: 0;
    background: linear-gradient(to right, #282A35 40%, rgba(40, 42, 53, 0));
}

.scroll-btn.right {
    right: 0;
    background: linear-gradient(to left, #282A35 40%, rgba(40, 42, 53, 0));
}

.scroll-btn i {
    pointer-events: none;
}

/* Main Layout: 3 Columns */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr 240px;
    gap: 2rem;
    padding: 0rem;
    min-height: calc(100vh - 140px);
}

/* Sidebar (Slider Submenu) */
.sidebar {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 100px;
}

/* Hide Sidebar Scrollbar */
.sidebar {
    scrollbar-width: thin; /* Firefox */
    -ms-overflow-style: thin; /* IE and Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.sidebar h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.submenu-list li {
    margin-bottom: 0;
}

.submenu-list a {
    display: block;
    padding: 0.05rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    transition: background 0.3s, color 0.3s;
    border: 2px solid transparent;
}

.submenu-list a:hover {
    background: #e0e7ff;
    color: var(--primary-color);
}

.submenu-list a.active {
    background: #e0e7ff;
    color: var(--primary-color);
    font-weight: 600;
    border: solid 2px var(--primary-color);
    padding: 0.05rem 9px;
    border-radius: 9px;
}

/* Center Content */
.content-area {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.content-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content-body p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Right Sidebar (Ads) */
.ads-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ad-card {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px dashed var(--border-color);
}

.ad-placeholder {
    background: #f1f5f9;
    height: 200px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Auth Logic (Modal/Form) */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.auth-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Footer */
.main-footer {
    background: var(--secondary-color);
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
}

.social-spaces {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.social-icon:hover {
    background: var(--primary-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 200px 1fr;
    }

    .ads-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
        /* Mobile menu needed */
    }

    .nav-menu {
        display: none;
        /* Hamburger needed */
    }
}

/* Code Block Styles */
pre {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

pre::-webkit-scrollbar {
    display: none;
}

pre code {
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    background: transparent !important;
    padding: 0 !important;
}

[onclick="copyCode(this)"]:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Accordion */
.accordion {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.accordion-item+.accordion-item {
    border-top: 1px solid var(--border-color);
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: #f8fafc;
    color: var(--text-primary);
    border: none;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.accordion-header i {
    transition: transform 0.2s ease;
}

.accordion-item.open .accordion-header i {
    transform: rotate(180deg);
}

.accordion-body {
    display: none;
    padding: 1rem 1.25rem;
    background: white;
    color: var(--text-secondary);
}

.accordion-item.open .accordion-body {
    display: block;
}