/* ==========================================================
   MAIN.CSS — Premium EnglishNet UI Redesign
   ========================================================== */

/* ----- Resets & Base ----- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em; /* Premium tight tracking */
    color: var(--text-color);
}
p { margin-bottom: var(--space-md); color: var(--text-muted); }
a { color: var(--color-sky); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-sky-hover); }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-md); }

/* ----- Layout & Utilities ----- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    width: 100%;
}
.section-padding { padding: var(--space-2xl) 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }
.relative { position: relative; }
.w-full { width: 100%; }

/* Typography Gradients */
.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: inline-block;
}
.dark-mode .text-gradient {
    background: var(--gradient-text-dark);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }

/* Grid System */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

/* ----- Components: Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius-full); /* Pill shape */
    border: none;
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), filter var(--transition-fast);
    line-height: 1;
    gap: 8px;
}
.btn:hover {
    transform: translateY(-2px) scale(1.02);
}
.btn:active {
    transform: translateY(1px) scale(0.98);
}
.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}
.btn-primary:hover {
    color: #fff;
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
    filter: brightness(1.1);
}
.btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background: var(--color-slate-100);
}
.dark-mode .btn-secondary:hover {
    background: var(--color-slate-800);
}
.btn-link {
    color: var(--color-sky);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-link svg { width: 18px; height: 18px; transition: transform var(--transition-fast); }
.btn-link:hover svg { transform: translateX(4px); }

/* ----- Header & Navigation ----- */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all var(--transition-normal);
    border-bottom: 1px solid transparent;
}
.site-header.is-sticky {
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}
.site-title { margin: 0; font-size: var(--text-xl); font-weight: 800; letter-spacing: -0.03em; }
.site-title a { color: var(--text-color); }
.desktop-menu ul {
    list-style: none;
    display: flex;
    gap: var(--space-md);
}
.desktop-menu a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: var(--text-sm);
}
.desktop-menu a:hover { color: var(--color-sky); }
.header-actions { display: flex; align-items: center; gap: var(--space-sm); }
.header-actions button {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast);
}
.header-actions button:hover { background: rgba(0,0,0,0.05); }
.dark-mode .header-actions button:hover { background: rgba(255,255,255,0.1); }
.header-actions svg { width: 20px; height: 20px; }
.mobile-menu-toggle { display: none; }

/* Off-canvas */
.mobile-offcanvas {
    position: fixed;
    inset: 0;
    z-index: 9999;
    visibility: hidden;
    pointer-events: none;
}
.mobile-offcanvas.is-active { visibility: visible; pointer-events: auto; }
.offcanvas-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.mobile-offcanvas.is-active .offcanvas-overlay { opacity: 1; }
.offcanvas-content {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    background: var(--card-bg);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    padding: var(--space-xl) var(--space-md);
}
.mobile-offcanvas.is-active .offcanvas-content { transform: translateX(0); }
.mobile-menu-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}
.mobile-menu-close svg { width: 24px; height: 24px; }
.mobile-navigation ul { list-style: none; }
.mobile-navigation li { margin-bottom: var(--space-md); }
.mobile-navigation a { font-size: var(--text-lg); font-weight: 600; color: var(--text-color); }

/* ----- Component: Premium Cards ----- */
.premium-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.card-image-wrapper {
    margin: calc(var(--space-md) * -1);
    margin-bottom: var(--space-md);
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--color-slate-100);
}
.dark-mode .card-image-wrapper { background: var(--color-slate-800); }
.card-image-wrapper img, .card-image-wrapper .placeholder-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.premium-card:hover .card-image-wrapper img,
.premium-card:hover .card-image-wrapper .placeholder-bg {
    transform: scale(1.05);
}
/* Placeholder gradient for missing images */
.placeholder-bg {
    background: linear-gradient(135deg, var(--color-slate-200), var(--color-slate-300));
}
.dark-mode .placeholder-bg {
    background: linear-gradient(135deg, var(--color-slate-700), var(--color-slate-800));
}

/* Course Card Specifics */
.course-card h3 { font-size: var(--text-lg); margin-bottom: var(--space-xs); }
.course-card p { font-size: var(--text-sm); margin-bottom: var(--space-md); flex-grow: 1; }
.course-card-meta {
    display: flex;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    align-items: center;
}
.difficulty-badge {
    background: var(--color-sky);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* Podcast Card */
.podcast-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-xl);
}
.podcast-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-sky);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}
.podcast-play-btn svg { width: 20px; height: 20px; margin-left: 2px; }
.podcast-card-info h4 { margin: 0 0 4px 0; font-size: var(--text-lg); }
.podcast-card-info span { font-size: var(--text-sm); color: var(--color-sky); font-weight: 500; }

/* Resource Card */
.resource-card {
    text-align: center;
    padding: var(--space-lg) var(--space-md);
}
.resource-card-icon {
    font-size: 40px;
    margin-bottom: var(--space-sm);
}
.resource-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: var(--color-slate-100);
    color: var(--text-muted);
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: var(--radius-md);
    font-weight: 600;
}
.dark-mode .resource-badge { background: var(--color-slate-800); }
.resource-download-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: var(--text-sm);
}
.resource-download-btn svg { width: 16px; height: 16px; }

/* Testimonial Card */
.testimonial-card {
    padding: var(--space-lg);
}
.testimonial-stars { color: #fbbf24; margin-bottom: var(--space-sm); font-size: 18px; letter-spacing: 2px; }
.testimonial-quote {
    font-size: var(--text-base);
    font-style: italic;
    color: var(--text-color);
    margin-bottom: var(--space-lg);
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: auto;
}
.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: var(--text-lg);
    flex-shrink: 0;
}
.testimonial-author-info h4 { margin: 0; font-size: var(--text-sm); }
.testimonial-author-info span { font-size: var(--text-xs); color: var(--text-muted); }

/* ----- Sections Specifics ----- */
.section-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-sm);
}

/* FAQ Accordion */
.faq-accordion { display: flex; flex-direction: column; gap: var(--space-sm); }
.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}
.faq-item:hover { box-shadow: var(--shadow-sm); }
.faq-question {
    width: 100%;
    text-align: left;
    padding: var(--space-md);
    background: transparent;
    border: none;
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-chevron { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}
.faq-item.is-open .faq-answer { max-height: 500px; }
.faq-answer-inner { padding: 0 var(--space-md) var(--space-md); color: var(--text-muted); font-size: var(--text-sm); }

/* ----- Footer (Grammarly/Linear Style) ----- */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--space-2xl) 0 var(--space-md);
    background: var(--bg-color);
}
.footer-widgets h3 { font-size: var(--text-base); margin-bottom: var(--space-md); }
.footer-widgets ul { list-style: none; }
.footer-widgets li { margin-bottom: var(--space-xs); }
.footer-widgets a { color: var(--text-muted); font-size: var(--text-sm); }
.footer-widgets a:hover { color: var(--text-color); }
.social-icons { display: flex; gap: var(--space-sm); }
.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-slate-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: var(--text-xs);
    font-weight: 600;
    transition: transform var(--transition-fast), background var(--transition-fast);
}
.dark-mode .social-link { background: var(--color-slate-800); }
.social-link:hover { transform: translateY(-2px); background: var(--color-slate-200); }
.dark-mode .social-link:hover { background: var(--color-slate-700); }
.footer-bottom {
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ----- Responsive Breakpoints ----- */
@media (min-width: 768px) {
    .md-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md-flex-row { flex-direction: row; }
}

@media (max-width: 767px) {
    .desktop-menu { display: none; }
    .mobile-menu-toggle { display: flex; }
    .header-cta { display: none; }
    
    .section-title { font-size: var(--text-2xl); }
    .section-padding { padding: var(--space-xl) 0; }
    
    .podcast-card { flex-direction: column; text-align: center; }
}
