/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary, #212529);
    background-color: var(--bg-primary, #ffffff);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header Styles */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 90px;
}

.header .container {
    height: 90px;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
    gap: 24px;
    width: 100%;
    padding: 0 40px;
}

.header-content .logo {
    flex-shrink: 0;
    margin-right: 0;
}

.header-content .search-bar {
    flex: 0 1 420px;
    min-width: 200px;
    margin-left: 50px;
    margin-right: auto;
}

.header-content .nav-menu {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #212529;
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
    gap: 12px;
}

.logo a img {
    height: 65px !important;
}

.logo i {
    color: #495057;
    flex-shrink: 0;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 250px;
    max-width: 400px;
    flex: 1;
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    color: #495057;
}

.search-bar input::placeholder {
    color: #6c757d;
}

.search-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

.search-btn:hover {
    color: #495057;
}

/* Navigation */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #495057;
    font-size: 17px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.nav-item:hover {
    background: #f8f9fa;
    color: #212529;
}

.nav-item i {
    margin-right: 7px;
    font-size: 17px;
}

.badge {
    background: #ffc107;
    color: #000;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
}

/* Account Dropdown */
.account-dropdown {
    position: relative;
}

.account-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #495057;
    font-size: 17px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-btn:hover {
    background: #f8f9fa;
    color: #212529;
}

.account-btn i:first-child {
    margin-right: 8px;
    font-size: 20px;
}

.account-btn i:last-child {
    margin-left: 8px;
    font-size: 14px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 1001;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #495057;
    font-size: 17px;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
}

.dropdown-menu a i {
    margin-right: 10px;
    width: 18px;
}

.dropdown-divider {
    height: 1px;
    background: #dee2e6;
    margin: 8px 0;
}

/* Main Content */
.main-content {
    margin-top: 90px;
    min-height: calc(100vh - 90px);
    padding: 40px 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0 0 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 60px;
}

/* Hero special pentru main page */
.hero-main {
    padding: 0 !important;
    aspect-ratio: 2 / 1;
    display: flex;
    align-items: flex-end;
    position: relative;
}

/* Gradient overlay pentru hero main */
.hero-main::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

/* Featured Subjects */
.featured-subjects h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 40px;
    text-align: center;
    color: #212529;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.subject-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.subject-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.subject-icon i {
    font-size: 32px;
    color: white;
}

.subject-card h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #212529;
}

.subject-card p {
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.subject-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.subject-stats span {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
}

.subject-stats i {
    margin-right: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .search-bar {
        min-width: 200px;
        margin: 0 20px;
    }
    
    .hero h1 {
        font-size: 36px;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }

    .hero-main {
        aspect-ratio: unset;
        min-height: 220px;
        align-items: flex-end;
    }
}

/* ============================================
   MOBILE NAV
   ============================================ */

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.nav-hamburger:hover {
    background: var(--interactive-hover, #f0f0f0);
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary, #212529);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger → X animation */
.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile overlay menu */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
}

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

.mobile-nav-panel {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-primary, #fff);
    border-bottom: 2px solid var(--border-primary, #e0e0e0);
    z-index: 999;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform: translateY(-110%);
    transition: transform 0.3s ease;
    max-height: calc(100vh - 70px);
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.mobile-nav-panel.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

/* Mobile search */
.mobile-search {
    display: flex;
    align-items: center;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-primary, #dee2e6);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.mobile-search input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 15px;
    color: var(--text-primary, #212529);
}

.mobile-search input::placeholder {
    color: var(--text-secondary, #6c757d);
}

.mobile-search button {
    background: none;
    border: none;
    color: var(--text-secondary, #6c757d);
    cursor: pointer;
    font-size: 15px;
}

/* Mobile nav items */
.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary, #212529);
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.mobile-nav-item:hover {
    background: var(--interactive-hover, #f0f0f0);
    color: var(--text-primary, #212529);
}

.mobile-nav-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary, #6c757d);
    font-size: 15px;
}

.mobile-nav-section {
    border-top: 1px solid var(--border-primary, #e9ecef);
    margin-top: 4px;
    padding-top: 4px;
}

.mobile-nav-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary, #6c757d);
    padding: 8px 14px 4px;
}

@media (max-width: 768px) {
    .header {
        height: 70px !important;
    }

    .header-content {
        height: 70px !important;
        padding: 0 16px !important;
        gap: 12px !important;
    }

    .logo a img {
        height: 46px !important;
    }

    .logo a span {
        display: none;
    }

    /* Hide desktop search and nav */
    .header-content .search-bar,
    .header-content .nav-menu {
        display: none !important;
    }

    .nav-hamburger {
        display: flex;
    }

    .main-content {
        margin-top: 70px !important;
    }

    .hero h1 { font-size: 28px; }
    .hero-stats { gap: 20px; }
    .subjects-grid { grid-template-columns: 1fr; }
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: #ffffff;
    color: #212529;
    padding: 52px 40px 0;
    margin-top: 60px;
    border-top: 3px solid #000000;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 48px;
    align-items: start;
    padding-bottom: 40px;
}

/* Brand column */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-brand-name {
    font-size: 20px;
    font-weight: 800;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.footer-brand-name i {
    color: #000000;
    font-size: 22px;
}

.footer-brand-desc {
    font-size: 15px;
    color: #666666;
    line-height: 1.7;
    max-width: 240px;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333333;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s;
}

.footer-social a:hover {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Link columns */
.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #000000;
    margin-bottom: 6px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.footer-col a {
    font-size: 16px;
    color: #666666;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-col a:hover {
    color: #000000;
    padding-left: 4px;
}

.footer-col a i {
    font-size: 12px;
    color: #e0e0e0;
    transition: color 0.2s;
}

.footer-col a:hover i {
    color: #000000;
}

/* Bottom bar */
.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-bottom-copy {
    font-size: 13px;
    color: #999999;
}

.footer-bottom-credit {
    font-size: 13px;
    color: #999999;
}

.footer-bottom-credit a {
    color: #000000;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.footer-bottom-credit a:hover {
    color: #333333;
}

@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 600px) {
    .site-footer {
        padding: 36px 20px 0;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}
