/**
 * Theme Name: TutorStarter Child
 * Description: Child theme for TutorStarter
 * Author: Your Name
 * Template: tutorstarter
 * Version: 1.0.0
 * Text Domain: tutorstarter-child
 */

/*
 * Import parent theme styles
 * Note: This @import method is kept for compatibility, but the recommended
 * approach is to enqueue styles in functions.php
 */
@import url("../tutorstarter/style.css");

/* 
 * Enhanced Header and Footer Styles
 * Custom styles for improved design and functionality
 */

/* ===== ENHANCED HEADER STYLES ===== */

/* ===== GLOBAL OVERFLOW FIX ===== */
/* Prevent horizontal scroll while allowing vertical scroll */
html {
    width: 100%;
    max-width: 100vw;
    scroll-behavior: smooth;
    overflow-y: scroll;
    overflow-x: hidden;
    height: 100%;
}

/* ===== DARK THEME FOR ENTIRE SITE ===== */
/* Note: Master colors are in modern-styles.css */
/* These are theme-specific overrides for child theme */

/* Apply dark theme globally - SINGLE body rule */
body {
    background: var(--bg-primary) !important;
    color: var(--text-primary);
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 100%;
    /* Let html handle scrolling */
}

/* Ensure the main site wrapper doesn't overflow */
#page,
.site {
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Ensure site content doesn't overflow */
#content,
.site-content {
    width: 100%;
    position: relative;
}

/* Prevent media from causing horizontal overflow */
img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* Ensure proper box-sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Ensure rows and containers don't overflow */
.row,
.container,
.container-fluid,
.elementor-section,
.elementor-row,
.elementor-container,
section {
    max-width: 100%;
}

/* Prevent text overflow */
pre,
code {
    overflow-x: auto;
    max-width: 100%;
    word-wrap: break-word;
}

/* Content wrapper dark theme */
.site-content,
.content-area,
main {
    background: var(--bg-primary);
    color: var(--text-primary);
    width: 100%;
}

/* Dark theme for all text elements */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

p {
    color: var(--text-secondary);
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

/* ===== GLOBAL LINK STYLES ===== */
a {
    color: var(--egyptian-blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-decoration-color: var(--egyptian-blue);
}

/* Top Bar Styles */
.top-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    font-size: 13px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left span {
    margin-right: 20px;
    color: var(--text-secondary);
    font-weight: 500;
}

.top-bar-left i {
    margin-right: 5px;
    color: var(--egyptian-blue);
}

.login-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 5px 15px;
    border-radius: 20px;
    background: var(--bg-tertiary);
}

.login-link:hover {
    color: var(--white);
    background: var(--egyptian-blue);
    transform: translateY(-1px);
}

/* ===== DYNAMIC HEADER HEIGHT SYSTEM ===== */
/* CSS Custom Properties for dynamic header spacing */
:root {
    --header-height: 60px;      /* Default fallback, JS will override */
    --admin-bar-height: 0px;    /* Will be set by JS when admin bar is present */
    --total-header-offset: calc(var(--header-height) + var(--admin-bar-height));
}

/* Main Header Styles */
.enhanced-header {
    position: fixed;
    top: var(--admin-bar-height);
    left: 0;
    right: 0;
    z-index: 99990; /* High z-index, just below WP admin bar (99999) */
    background: var(--bg-card);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
    transition: top 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

/* 
 * Body padding is now set directly by JS as inline style for maximum responsiveness.
 * The classes below are for fallback/debugging purposes only.
 * JS sets document.body.style.paddingTop directly on every resize/measurement.
 */

/* Fallback when JS hasn't loaded yet - pages WITH header */
body:not(.header-height-set):not(.admin-bar) {
    padding-top: 60px; /* Basic fallback before JS runs */
}

/* Admin bar fallback for pages before JS loads */
body.admin-bar:not(.header-height-set) {
    padding-top: 92px; /* 60px header + 32px admin bar */
}

@media screen and (max-width: 782px) {
    body.admin-bar:not(.header-height-set) {
        padding-top: 106px; /* 60px header + 46px admin bar on mobile */
    }
}

/* No padding when header is explicitly not present (set by JS) */
body.no-fixed-header {
    padding-top: 0 !important;
}

/* When JS has set the height, inline style takes over - no CSS interference */
body.header-height-set {
    /* Padding controlled by inline style from JS - do not override */
}

.enhanced-header.scrolled {
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.7);
    border-bottom-color: var(--border-light);
}

.main-header {
    padding: 8px 0;
    background: var(--bg-card);
    width: 100%;
}

/* Header container - Full width */
.main-header .container,
.enhanced-header .container {
    max-width: 100%;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .main-header .container,
    .enhanced-header .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

.enhanced-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    width: 100%;
    min-height: 44px;
}

/* Logo/Brand Styles */
.enhanced-brand {
    flex-shrink: 0;
    max-width: 200px;
    order: 1; /* Logo first (appears on right in RTL) */
}

@media (max-width: 1200px) {
    .enhanced-brand {
        max-width: 150px;
        order: 1; /* Keep logo on right in RTL */
    }
}

.site-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--egyptian-blue);
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    position: relative;
}

.site-title:hover {
    color: var(--accent-hover);
    transform: scale(1.05);
}

/* Custom logo image styling */
.enhanced-brand img,
.enhanced-brand .custom-logo {
    max-height: 40px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.enhanced-brand img:hover,
.enhanced-brand .custom-logo:hover {
    transform: scale(1.03);
}

@media (max-width: 1200px) {
    .enhanced-brand img,
    .enhanced-brand .custom-logo {
        max-height: 32px;
    }
}

.enhanced-brand a {
    color: var(--egyptian-blue);
    text-decoration: none;
}

/* Search Styles - Egyptian Theme */
.header-search {
    flex: 1 1 auto;
    max-width: 300px;
    margin: 0 15px;
    min-width: 0;
    order: 2; /* Search in middle */
}

@media (max-width: 1200px) {
    .header-search {
        max-width: 220px;
        margin: 0 10px;
    }
}

.search-input-wrapper {
    position: relative;
    display: flex;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 36px;
    background: var(--bg-surface);
    align-items: center;
    gap: 5px;
}

.search-input-wrapper:focus-within {
    transform: translateY(-1px);
}

.search-input {
    flex: 1;
    padding: 8px 40px 8px 15px;
    border: none;
    outline: none;
    font-size: 12px;
    background: transparent;
    height: 100%;
    direction: rtl;
    text-align: right;
    color: var(--text-primary);
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 500;
}



.search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.search-button {
    position: absolute;
    left: 39px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: linear-gradient(135deg, var(--egyptian-blue) 0%, var(--egyptian-blue-dark) 100%);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(47, 134, 255, 0.3);
}

.search-button:hover {
    background: linear-gradient(135deg, var(--egyptian-blue-dark) 0%, var(--egyptian-blue) 100%);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(47, 134, 255, 0.5);
}

.search-form .search-submit,
.search-form button {
    left: 5px;
    right: auto;
}

/* Navigation Styles */
.navbar-nav .menu-item a {
  color: #fff !important;
}

.navbar-nav-wrapper {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    order: 2; /* Navigation in middle on desktop */
}

.enhanced-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.enhanced-nav li {
    margin: 0 12px;
    position: relative;
}

.enhanced-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 0;
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.enhanced-nav a:hover {
    color: var(--egyptian-blue);
}

.enhanced-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--egyptian-blue);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.enhanced-nav a:hover::after,
.enhanced-nav .current-menu-item a::after {
    width: 100%;
}

.enhanced-nav .current-menu-item a {
    color: var(--egyptian-blue);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    order: 3; /* Actions last (appears on left in RTL) */
}

.login-btn,
.cta-button {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-size: 13px;
}

.login-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.login-btn:hover {
    background: var(--egyptian-blue);
    border-color: var(--egyptian-blue);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(47, 134, 255, 0.4);
}

.cta-button {
    background: linear-gradient(135deg, var(--egyptian-blue) 0%, var(--egyptian-blue-dark) 100%);
    color: var(--white);
    border: 2px solid transparent;
    box-shadow: 0 3px 10px rgba(47, 134, 255, 0.3);
}

.cta-button:hover {
    background: linear-gradient(135deg, var(--egyptian-blue-dark) 0%, var(--egyptian-blue) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(47, 134, 255, 0.5);
    color: var(--white);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    z-index: 1002;
}

.header-account {
    position: relative;
    z-index: 1002;
}

.user-toggle {
    background: none;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.user-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.03);
}

.user-toggle:active {
    transform: scale(0.98);
}

.user-toggle i {
    color: var(--text-primary);
    font-size: 10px;
    transition: transform 0.3s ease;
}

.user-dropdown.active .user-toggle i,
.user-menu.active ~ .user-toggle i {
    transform: rotate(180deg);
}

.user-toggle img,
.user-toggle .avatar {
    border-radius: 50% !important;
    width: 28px !important;
    height: 28px !important;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

/* User Menu - Pure CSS positioning based on screen width */
.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    border: 1px solid var(--border-color);
    pointer-events: none;
}

/* User menu active state - consistent for all screen sizes */
.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}


/* Add arrow indicator for dropdown */
.user-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 180px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--border-color);
}

/* Large desktop (>1400px) */
@media (min-width: 1401px) {
    .user-menu {
        right: -160px;
    }
}

/* Desktop (1041px - 1400px) */
@media (min-width: 1201px) and (max-width: 1400px) {
    .user-menu {
        right: -160px;
    }
}

/* Tablet and phone (<=1040px) - unified styles */
@media (max-width: 1200px) {
    .user-menu {
        right: -160px;
        min-width: 220px;
    }
}

/* Small phone (<=480px) */
@media (max-width: 480px) {
    .user-menu {
        right: -10px;
        min-width: 200px;
    }

    .user-menu::before {
        right: 30px;
    }
}


.user-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 600;
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.user-menu a:first-child {
    border-radius: 15px 15px 0 0;
}

.user-menu a:last-child {
    border-bottom: none;
    border-radius: 0 0 15px 15px;
}

.user-menu a:hover {
    background: var(--bg-tertiary);
    color: var(--egyptian-blue);
    padding-right: 25px;
}

.user-menu a i {
    margin-left: 12px;
    margin-right: 0;
    font-size: 14px;
    opacity: 0.8;
    width: 18px;
    color: var(--egyptian-blue);
}

.user-menu .menu-divider {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

/* Mobile Styles */
.enhanced-toggler {
    display: none;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    gap: 4px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.enhanced-toggler:hover {
    background: var(--bg-tertiary);
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.toggler-icon {
    width: 20px;
    height: 2px;
    background: var(--egyptian-blue);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.enhanced-toggler.active .toggler-icon:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.enhanced-toggler.active .toggler-icon:nth-child(2) {
    opacity: 0;
}

.enhanced-toggler.active .toggler-icon:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-search {
    background: var(--bg-surface);
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    display: none;
}

.mobile-search.active {
    display: block;
}

.mobile-search-toggle {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.mobile-search-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.close-search {
    background: var(--egyptian-red);
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--white);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Utility Classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Prevent scroll when mobile menu is open */
body.menu-open {
    overflow: hidden !important;
    /* Note: Using overflow:hidden on both html and body instead of position:fixed
       This prevents scroll issues when the menu closes */
}

/* Ensure html doesn't interfere when menu is open */
html.sidebar-open,
html.menu-open {
    overflow: hidden !important;
}

/* Ensure proper scroll restoration when menu closes */
html:not(.sidebar-open):not(.menu-open),
body:not(.menu-open) {
    /* Allow scrolling when menu is not open */
}

/* ===== ENHANCED FOOTER STYLES ===== */

.enhanced-footer {
    background: var(--bg-card);
    color: var(--text-primary);
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer-main {
    padding: 60px 0 40px;
}

.footer-main .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
    padding-inline: 1rem;
}

.footer-column {
    margin-bottom: 30px;
    padding-right: 30px;
    padding-left: 30px;
}

/* Fix footer column widths for wide displays */
/* Use 3-column layout on large screens to prevent overlap */
@media (min-width: 992px) {
    .footer-main .row {
        justify-content: space-between;
    }
    
    .footer-column.col-lg-4,
    .footer-column.col-lg-2 {
        flex: 0 0 calc(25% - 30px);
        max-width: calc(25% - 30px);
    }
}

.footer-widget {
    height: 100%;
}

.footer-logo img {
    max-height: 50px;
    margin-bottom: 20px;
}

.footer-site-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
}

.footer-description p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    transition: all 0.3s ease;
}

.social-link.facebook {
    background: #3b5998;
}

.social-link.twitter {
    background: #1da1f2;
}

.social-link.linkedin {
    background: #0077b5;
}

.social-link.instagram {
    background: #e4405f;
}

.social-link.youtube {
    background: var(--egyptian-red);
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.footer-widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
    color: var(--text-primary);
}

.footer-widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: auto;
    width: 50px;
    height: 2px;
    background: var(--egyptian-blue);
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 12px;
}

.footer-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 13px;
    display: flex;
    align-items: center;
    direction: rtl;
    text-align: right;
    line-height: 1.5;
}

.footer-menu a:hover {
    color: var(--egyptian-blue);
    padding-right: 5px;
}

.footer-menu a i {
    margin-left: 8px;
    margin-right: 0;
    font-size: 12px;
    opacity: 0.7;
    width: 16px;
    flex-shrink: 0;
    color: var(--egyptian-blue);
}

.contact-info {
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    direction: rtl;
    text-align: right;
}

.contact-item i {
    width: 18px;
    color: var(--egyptian-blue);
    margin-left: 12px;
    margin-right: 0;
    font-size: 14px;
    text-align: center;
}

.contact-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--egyptian-blue);
}

/* Newsletter Styles - Compact */
.newsletter-signup {
    margin-top: 20px;
}

.newsletter-signup h5 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.newsletter-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.input-group {
    display: flex;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
    height: 38px;
    background: var(--bg-surface);
}

.input-group:focus-within {
    border-color: var(--egyptian-blue);
}

.input-group input {
    flex: 1;
    padding: 8px 15px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    direction: rtl;
    text-align: right;
    height: 100%;
}

.input-group input::placeholder {
    color: var(--text-muted);
    font-size: 12px;
}

.subscribe-btn {
    padding: 8px 15px;
    background: var(--egyptian-blue);
    border: none;
    color: var(--white);
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subscribe-btn:hover {
    background: var(--egyptian-blue-dark);
}

/* Footer Bottom */
.footer-bottom {
    background: var(--bg-secondary);
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.copyright {
    color: var(--text-muted);
    margin: 0;
}

.bottom-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    gap: 20px;
}

.bottom-menu a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.bottom-menu a:hover {
    color: var(--egyptian-blue);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--egyptian-blue);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: var(--shadow-md);
}

.back-to-top:hover {
    background: var(--egyptian-blue-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ===== RESPONSIVE STYLES ===== */

/* Large Desktop - Full Menu */
@media (min-width: 1200px) {
    .enhanced-nav li {
        margin: 0 15px;
    }
}

/* Medium Desktop - Tighter Menu (1200px - 1400px) */
@media (min-width: 1201px) and (max-width: 1400px) {
    .header-search {
        max-width: 280px;
        margin: 0 20px;
    }
    
    .enhanced-nav li {
        margin: 0 10px;
    }
    
    .enhanced-nav a {
        font-size: 15px;
    }
}

/* Broken Range Fix: Hide desktop menu, show mobile menu */
@media (max-width: 1200px) {
    .header-search {
        display: none;
    }
    
    .navbar-nav-wrapper {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        padding: 0;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100001; /* Above WordPress admin bar (99999) */
        box-shadow: 4px 0 30px rgba(0,0,0,0.7);
        overflow-y: auto;
    }
    
    .navbar-nav-wrapper.active {
        left: 0;
    }
    
    .enhanced-nav {
        flex-direction: column;
        width: 100%;
        padding: 10px 0;
    }
    
    .enhanced-nav li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .enhanced-nav a {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        width: 100%;
        font-size: 16px;
        color: var(--text-primary);
    }
}

/* Show menu button below 1040px - Unified tablet/phone styles */
@media (max-width: 1200px) {
    .enhanced-toggler {
        display: flex;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    .mobile-search-toggle {
        display: flex;
    }
    
    .top-bar {
        display: none;
    }
    
    .main-header {
        padding: 10px 0;
    }
    
    /* Mobile Menu Header */
    .mobile-menu-header {
        padding: 25px;
        background: var(--bg-secondary);
        color: var(--text-primary);
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-menu-logo {
        font-size: 18px;
        font-weight: 800;
        color: var(--egyptian-blue);
        font-family: 'Cairo', 'Tajawal', sans-serif;
    }
    
    .mobile-menu-close {
        background: var(--bg-tertiary);
        border: 2px solid var(--border-color);
        color: var(--text-primary);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 20px;
        transition: all 0.3s ease;
        box-shadow: var(--shadow-sm);
    }
    
    .mobile-menu-close:hover {
        background: var(--egyptian-blue);
        border-color: var(--egyptian-blue);
        color: var(--white);
        transform: rotate(90deg) scale(1.1);
        box-shadow: var(--shadow-md);
    }
    
    /* Mobile Search Section */
    .mobile-menu-search {
        padding: 20px;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-menu-search .search-input-wrapper {
        width: 100%;
        max-width: none;
    }
    
    /* Mobile Navigation */
    .enhanced-nav a:hover {
        background: var(--bg-tertiary);
        padding-right: 30px;
        color: var(--egyptian-blue);
        border-right: 4px solid var(--egyptian-blue);
    }
    
    .enhanced-nav a::after {
        display: none;
    }
    
    .enhanced-nav a i {
        margin-left: 10px;
        width: 20px;
        text-align: center;
    }
    
    /* Mobile Menu Actions */
    .mobile-menu-actions {
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        border-top: 1px solid var(--border-color);
        margin-top: auto;
        background: var(--bg-surface);
    }
    
    .mobile-menu-actions .cta-button {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
        font-size: 16px;
        box-shadow: 0 4px 15px rgba(47, 134, 255, 0.4);
    }
    
    .mobile-menu-actions .login-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 22px;
        font-size: 16px;
    }
    
    /* Mobile User Menu */
    .mobile-user-menu {
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-surface);
    }
    
    .mobile-user-menu h4 {
        font-size: 14px;
        color: var(--egyptian-blue);
        margin-bottom: 15px;
        text-transform: uppercase;
        letter-spacing: 1px;
        font-weight: 700;
        font-family: 'Cairo', 'Tajawal', sans-serif;
    }
    
    .mobile-user-links {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    
    .mobile-user-links a {
        padding: 14px 0;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-primary);
        text-decoration: none;
        display: flex;
        align-items: center;
        font-size: 14px;
        transition: all 0.3s ease;
        font-weight: 600;
        font-family: 'Cairo', 'Tajawal', sans-serif;
    }
    
    .mobile-user-links a:last-child {
        border-bottom: none;
    }
    
    .mobile-user-links a:hover {
        color: var(--egyptian-blue);
        padding-right: 15px;
        background: var(--bg-tertiary);
    }
    
    .mobile-user-links a i {
        margin-left: 12px;
        width: 20px;
        opacity: 0.8;
        color: var(--egyptian-blue);
    }
    
    .header-actions {
        gap: 10px;
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000; /* Above WordPress admin bar (99999) */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    /* Phone-specific styles (smaller screens) */
    html {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Keep user menu consistent with tablet - no left positioning */
    
    /* Footer Mobile Styles */
    .footer-main {
        padding: 40px 0 20px;
    }
    
    .footer-column {
        margin-bottom: 40px;
    }
    
    .footer-social {
        justify-content: center;
        margin-top: 20px;
    }
    
    .bottom-menu {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
        margin-top: 15px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    /* Body padding handled by CSS variables - see dynamic header height system */
}

@media (max-width: 480px) {
    .enhanced-navbar {
        padding: 0 8px;
    }
    
    .site-title {
        font-size: 18px;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .main-header {
        padding: 6px 0;
    }
    
    /* Body padding handled by CSS variables - see dynamic header height system */
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .enhanced-header {
        background: #1a1a1a;
        color: white;
    }
    
    .search-input-wrapper {
        border-color: transparent;
    }
    
    .search-input {
        color: white;
    }
    
    .enhanced-nav a {
        color: white;
    }
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-column {
    animation: fadeInUp 0.6s ease;
}

.footer-column:nth-child(2) {
    animation-delay: 0.1s;
}

.footer-column:nth-child(3) {
    animation-delay: 0.2s;
}

.footer-column:nth-child(4) {
    animation-delay: 0.3s;
}

/* ============================
   ARABIC SHORTCODES STYLING
   ============================ */

/* Common Container and Typography */
.elraed-landing-hero,
.elraed-landing-features,
.elraed-landing-stats,
.elraed-landing-testimonials,
.elraed-courses-grid,
.elraed-courses-filter,
.elraed-cart-summary,
.elraed-student-signup,
.elraed-student-signin,
.elraed-instructor-signup,
.elraed-instructor-signin {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
    width: 100%;
}

input[type=email],
input[type=password],
input[type=tel],
input[type=number] {
    direction: ltr;
    text-align: left;
}

.tutor-dashboard-menu-item-link {
    color: #fff !important;
}

/* Hide Coupons menu for students - JS will handle role-based visibility */
/* This provides a CSS fallback while JS loads */
body.role-subscriber .tutor-dashboard-menu-item a[href*="coupon"],
body.role-subscriber [class*="coupon"],
body.role-student .tutor-dashboard-menu-item a[href*="coupon"],
body.role-student [class*="coupon"] {
    display: none !important;
}

/* Container defaults */
.container,
.container-fluid {
    max-width: 100%;
}

/* Shortcode containers with proper width */
.elraed-landing-hero .container,
.elraed-landing-features .container,
.elraed-landing-stats .container,
.elraed-landing-testimonials .container,
.elraed-courses-grid .container,
.elraed-courses-filter .container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    position: relative;
    display: flex;
    justify-content: center;
    text-align: center !important;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--egyptian-blue) 0%, var(--egyptian-blue) 100%);
    border-radius: 2px;
}

/* ============================
   LANDING PAGE HERO SECTION
   ============================ */

.elraed-landing-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="%23ffffff" opacity="0.1"/><circle cx="80" cy="80" r="2" fill="%23ffffff" opacity="0.1"/></svg>');
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.6rem;
    margin-bottom: 25px;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.5;
    color: #eee;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 40px;
    opacity: 0.8;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-btn {
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.hero-btn.btn-primary {
    background: var(--egyptian-black);
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hero-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    background: var(--egyptian-black-dark);
}

.hero-btn.btn-outline {
    background: transparent;
    color: white;
    border-color: var(--egyptian-black);
    display: flex;
    justify-content: center;
}

.hero-btn.btn-outline:hover {
    background: var(--egyptian-black);
    color: white;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ============================
   LANDING PAGE FEATURES
   ============================ */
.elraed-landing-features {
    padding: 100px 0;
    background: var(--bg-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 40px;
    margin-top: 60px;
    width: 100%;
}

.feature-item {
    background: var(--bg-card);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--egyptian-blue);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-item:hover::before {
    transform: scaleX(1);
}

.feature-item:hover {
    box-shadow: var(--shadow-lg);
    background: var(--bg-tertiary);
    transform: translateY(-4px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, var(--egyptian-blue), var(--egyptian-blue-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 2rem;
    color: var(--white);
}

.feature-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
}

/* ============================
   LANDING PAGE STATISTICS
   ============================ */
.elraed-landing-stats {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--egyptian-blue) 0%, var(--egyptian-blue-dark) 100%);
    color: var(--white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 40px;
    width: 100%;
}

.stat-item {
    text-align: center;
    padding: 30px 20px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 10px;
    display: block;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* ============================
   LANDING PAGE TESTIMONIALS
   ============================ */
.elraed-landing-testimonials {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 40px;
    margin-top: 60px;
    width: 100%;
}

.testimonial-item {
    background: var(--bg-card);
    padding: 40px 30px;
    border-radius: 15px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.testimonial-item::before {
    content: '\275d';
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 4rem;
    color: var(--egyptian-blue);
    opacity: 0.2;
}

.testimonial-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.testimonial-content {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 25px;
    color: var(--text-secondary);
    font-style: italic;
}

.testimonial-rating {
    color: var(--egyptian-gold);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.author-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.author-position {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ============================
   COURSES GRID
   ============================ */
.elraed-courses-grid {
    padding: 80px 0;
    background: var(--bg-primary);
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 40px;
    margin: 60px 0;
    width: 100%;
}

.course-item {
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.course-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.course-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--egyptian-blue), var(--egyptian-blue-dark));
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--egyptian-blue), var(--egyptian-blue-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.course-placeholder::after {
    content: '\1f4da';
    font-size: 3rem;
    opacity: 0.7;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.course-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.course-title a:hover {
    color: var(--egyptian-blue);
}

.course-instructor {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.course-meta {
    margin-bottom: 25px;
}

.course-rating {
    color: var(--egyptian-gold);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.rating-number {
    color: var(--text-muted);
    margin-right: 5px;
}

.course-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.course-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.course-actions {
    display: flex;
    gap: 10px;
}

.section-footer {
    text-align: center;
    margin-top: 60px;
}

/* ============================
   COURSES FILTER
   ============================ */
.elraed-courses-filter {
    background: var(--bg-secondary);
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
}

.filter-controls {
    margin-bottom: 30px;
}

.filter-controls h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.filter-btn {
    padding: 12px 25px;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--egyptian-blue);
    color: var(--white);
    border-color: var(--egyptian-blue);
}

.search-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.search-input:focus {
    border-color: var(--egyptian-blue);
}

.search-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--egyptian-blue);
    color: var(--white);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-select {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    min-width: 200px;
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* ============================
   SHOPPING CART
   ============================ */
.elraed-cart-summary {
    padding: 60px 0;
    background: var(--bg-primary);
}

.cart-header {
    text-align: center;
    margin-bottom: 50px;
}

.cart-header h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.cart-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    align-items: start;
}

.cart-item {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 25px;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.item-image {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.item-details h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.instructor {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.item-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.item-price {
    text-align: center;
}

.price {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--egyptian-blue);
    display: block;
    margin-bottom: 10px;
}

.remove-item {
    background: var(--egyptian-red);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.remove-item:hover {
    background: var(--egyptian-red);
    opacity: 0.8;
}

.cart-sidebar {
    position: sticky;
    top: 20px;
}

.cart-summary-box {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.cart-summary-box h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    text-align: center;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1rem;
}

.summary-item.total {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-primary);
    padding-top: 15px;
}

.cart-actions {
    margin: 25px 0;
}

.btn-full {
    width: 100%;
    margin-bottom: 15px;
}

.payment-methods {
    margin-top: 30px;
    text-align: center;
}

.payment-methods h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-muted);
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.empty-cart {
    text-align: center;
    padding: 80px 20px;
}

.empty-cart-content i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.empty-cart-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

/* ============================
   AUTHENTICATION FORMS
   ============================ */
.elraed-student-signup,
.elraed-student-signin,
.elraed-instructor-signup,
.elraed-instructor-signin {
    padding: 80px 0;
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.signup-form-wrapper,
.signin-form-wrapper {
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.elraed-instructor-signup .signup-form-wrapper {
    max-width: 800px;
}

.form-header {
    background: linear-gradient(135deg, var(--egyptian-blue), var(--egyptian-blue-dark));
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
}

.form-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-align: center !important;
}

.form-header p {
    opacity: 0.9;
    font-size: 1.1rem;
    text-align: center !important;
}

.signup-form,
.signin-form,
.instructor-signup-form,
.instructor-signin-form {
    padding: 40px 30px;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 1.3rem;
    color: var(--egyptian-blue);
    margin-bottom: 25px;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media screen and (max-width: 600px){
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background: var(--bg-surface);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--egyptian-blue);
    box-shadow: 0 0 0 3px rgba(47, 134, 255, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    line-height: 1.5;
    font-size: 0.95rem;
    padding-right: 20px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background: #333;
    right: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--egyptian-blue);
    border-color: var(--egyptian-blue);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '\2713';
    position: absolute;
    top: 20%;
    left: 60%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 0.8rem;
    font-weight: bold;
    border: none;
}

.password-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.forgot-password {
    color: var(--egyptian-blue);
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password:hover {
    text-decoration: underline;
}

.form-actions {
    margin: 30px 0;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--egyptian-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--egyptian-blue-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--egyptian-blue);
    border-color: var(--egyptian-blue);
}

.btn-outline:hover {
    background: var(--egyptian-blue);
    color: var(--white);
}

.btn-outline-primary {
    background: transparent;
    color: var(--egyptian-blue);
    border-color: var(--egyptian-blue);
}

.btn-outline-primary:hover {
    background: var(--egyptian-blue);
    color: var(--white);
}

.btn-full {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

.btn-google {
    background: #db4437;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-facebook {
    background: #3b5998;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-footer {
    padding: 30px;
    background: var(--bg-surface);
    text-align: center;
}

.form-footer p {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--egyptian-blue);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.social-signup,
.social-signin {
    margin-top: 25px;
}

.social-signup p,
.social-signin p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.social-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.social-buttons .btn {
    flex: 1;
    max-width: 150px;
}

.instructor-benefits,
.instructor-dashboard-preview {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.instructor-benefits h4,
.instructor-dashboard-preview h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.instructor-benefits ul,
.instructor-dashboard-preview ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instructor-benefits li,
.instructor-dashboard-preview li {
    padding: 8px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructor-benefits i,
.instructor-dashboard-preview i {
    color: var(--egyptian-blue);
    width: 16px;
}

.elraed-cta-section {
    background: var(--egyptian-blue-dark);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.elraed-cta-section h2, .elraed-cta-section p {
    display: flex;
    justify-content: center;
    text-align: center !important;
}

/* ===== Modern Sidebar Menu (mobile) ===== */
:root {
    --sidebar-bg: var(--bg-card);
    --sidebar-bg-alt: var(--bg-secondary);
    --sidebar-text: var(--text-primary);
    --sidebar-text-muted: var(--text-muted);
    --sidebar-accent: var(--egyptian-blue);
    --sidebar-border: var(--border-color);
}

/* Sidebar toggle button */
.sidebar-toggle {
    position: relative;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    cursor: pointer;
    padding: 0;
    margin-inline-start: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
    order: 4; /* After header-actions in RTL */
}

.sidebar-toggle__line {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--egyptian-blue);
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--egyptian-blue);
    transform: scale(1.03);
}

/* Sidebar wrapper and overlay */
.sidebar-menu-wrapper {
    position: fixed;
    inset: 0;
    z-index: 100001; /* Above WordPress admin bar (99999) */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-menu-wrapper.is-active {
    pointer-events: auto;
    opacity: 1;
}

/* Lower admin bar z-index when sidebar menu is open */
html.sidebar-open #wpadminbar,
html.menu-open #wpadminbar {
    z-index: 9999 !important;
}

.sidebar-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

/* Sidebar panel */
.sidebar-menu {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(320px, 80vw);
    background: radial-gradient(circle at top, #111827 0, var(--sidebar-bg) 60%);
    color: var(--sidebar-text);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.8);
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    display: flex;
    flex-direction: column;
    right: 0;
    z-index: 10000;
}

.sidebar-menu-wrapper.is-active .sidebar-menu {
    transform: translateX(0);
}

/* Sidebar header */
.sidebar-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(90deg, var(--sidebar-bg-alt), var(--sidebar-bg));
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-menu__title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--sidebar-text-muted);
}

/* Close button */
.sidebar-menu__close {
    border: none;
    background: transparent;
    color: var(--sidebar-text);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.1s ease;
}

.sidebar-menu__close:hover {
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-1px);
}

/* Sidebar menu list */
.sidebar-menu-nav {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0.75rem 0 1.25rem;
    overflow-y: auto;
    height: 300vh;
}

.sidebar-menu-nav > li {
    display: block;
}

/* Hide legacy close item inside menu if present */
.sidebar-menu .nav-close {
    display: none !important;
}

/* Top-level items */
.sidebar-menu-nav > li.menu-item {
    margin: 0.15rem 0.75rem;
}

.sidebar-menu-nav > li.menu-item > a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease;
    position: relative;
}

/* Active/current item */
.sidebar-menu-nav > li.current-menu-item > a,
.sidebar-menu-nav > li.current_page_item > a {
    background: linear-gradient(135deg, var(--sidebar-accent), var(--egyptian-blue-dark));
    color: #0f172a;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
}

/* Hover state */
.sidebar-menu-nav > li.menu-item:not(.current-menu-item):not(.current_page_item) > a:hover {
    background: rgba(148, 163, 184, 0.08);
    transform: translateY(-1px);
}

/* Left border accent on hover */
.sidebar-menu-nav > li.menu-item > a::before {
    content: "";
    position: absolute;
    inset-block: 0.45rem;
    inset-inline-start: 0.35rem;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.18s ease;
}

.sidebar-menu-nav > li.menu-item > a:hover::before {
    background: var(--sidebar-accent);
}

/* Submenu arrows */
.sidebar-menu .menu-item-has-children > a {
    justify-content: space-between;
    position: relative;
}

.sidebar-menu .menu-item-has-children > a::after {
    content: "\25BE";  /* Down arrow using CSS escape */
    font-size: 1.2rem;
    opacity: 0.7;
    margin-inline-start: auto;
    padding-inline-start: 0.5rem;
    transition: transform 0.18s ease, opacity 0.18s ease;
    flex-shrink: 0;
}

.sidebar-menu .menu-item-has-children.is-open > a::after {
    transform: rotate(180deg);
    opacity: 1;
}

/* Submenu container - positioned directly under parent */
.sidebar-menu .menu-item-has-children {
    position: relative;
}

.sidebar-menu .menu-item-has-children > .sub-menu {
    list-style: none;
    margin: 0;
    margin-top: 0.25rem;
    margin-inline-start: 1rem;
    margin-inline-end: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(55, 65, 81, 0.7);
    border-inline-start: 3px solid var(--sidebar-accent);
    max-height: auto;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.3s ease-out,
        opacity 0.2s ease,
        padding 0.2s ease;
    width: 100%;
}

/* Visible submenu */
/* .sidebar-menu .menu-item-has-children .sub-menu {
    max-height: 500px;
    opacity: 1;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
} */

/* Submenu links */
.sidebar-menu .sub-menu > li {
    margin: 0;
}

.sidebar-menu .sub-menu > li > a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--sidebar-text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.16s ease, background 0.16s ease, padding 0.16s ease;
    border-radius: 6px;
}

.sidebar-menu .sub-menu > li > a:hover {
    color: var(--sidebar-accent);
    background: rgba(47, 134, 255, 0.1);
    padding-inline-start: 1rem;
}

/* Hide desktop nav wrapper on small screens (use sidebar instead) */
@media (max-width: 1200px) {
    .navbar-nav-wrapper {
        display: none !important;
    }

    .sidebar-toggle {
        display: inline-flex;
        order: 4; /* Hamburger menu on far left in RTL */
    }
    
    /* Hide top bar on tablets/phones */
    .top-bar {
        display: none;
    }
    
    /* Show mobile search toggle on tablets */
    .mobile-search-toggle {
        display: flex;
    }
    
    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }
    
    /* Show mobile-only elements */
    .mobile-only {
        display: block;
    }
    
    /* Reduce header padding on tablets/phones */
    .main-header {
        padding: 6px 0;
    }
    
    /* RTL Layout: Logo right, Actions left */
    .enhanced-navbar {
        flex-direction: row;
    }
    
    .enhanced-brand {
        order: 1; /* Logo on right in RTL */
        flex: 1;
    }
    
    .header-actions {
        order: 3; /* Actions in middle-left area */
        gap: 8px;
    }
    
    .sidebar-toggle {
        order: 4; /* Hamburger on far left in RTL */
        margin-right: 8px;
    }
    
    /* Compact buttons on tablet */
    .login-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .user-toggle {
        padding: 4px 8px;
    }
    
    .user-toggle img,
    .user-toggle .avatar {
        width: 26px !important;
        height: 26px !important;
    }
}

/* Hide sidebar on larger screens */
@media (min-width: 1201px) {
    .sidebar-menu-wrapper {
        display: none;
    }
}


.tutor-spotlight-mobile-progress-complete {
    background-color: var(--egyptian-blue-dark);
}

.page-content .search-form label {
    width: 100%;
}

.page-content .search-form .search-submit {
    right: unset;
    left: 5px;
    width: fit-content;
}

.tutor-checkout-page .tutor-checkout-details .tutor-checkout-details-inner {
    background-color: var(--bg-tertiary);
}

.tutor-checkout-billing .email-feedback {
    display: none;
}

.tutor-checkout-billing .tutor-billing-fields .tutor-col-12:first-of-type .tutor-form-control {
    border-left: 1px solid var(--tutor-border-color) !important;
    border-right: 1px solid var(--tutor-border-color) !important;
    border-top-right-radius: 6px !important;
    border-top-left-radius: 0 !important;
}

.tutor-checkout-billing .tutor-billing-fields .tutor-col-12:nth-of-type(2) .tutor-form-control {
    border-right: none !important;
    border-left: 1px solid var(--tutor-border-color) !important;;
    border-top-left-radius: 6px !important;
    border-top-right-radius: 0 !important;
}

.tutor-checkout-billing .tutor-billing-fields .tutor-col-sm-6:nth-of-type(2n+1) .tutor-form-control {
    border-right: none !important;
}