/* =============================================
   Site-wide Styles for Watawdeh Math Center
   Font: Tajawal from Google Fonts
   Colors: Dark Blue (#0A2463), Gold (#FFD23F), White
   Direction: RTL (Arabic)
   ============================================= */

/* Import Tajawal Font */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* Root Variables */
:root {
    --primary-blue: #0F172A;
    --secondary-blue: #1E40AF;
    --accent-cyan: #06B6D4;
    --light-cyan: #22D3EE;
    --dark-cyan: #0891B2;
    --accent-emerald: #10B981;
    --white: #FFFFFF;
    --light-gray: #F8FAFC;
    --text-gray: #64748B;
    --dark-text: #0F172A;
    --border-color: #E2E8F0;
    --success-green: #10B981;
    --error-red: #EF4444;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    
    /* Gradient Combinations */
    --gradient-primary: linear-gradient(135deg, #1E40AF 0%, #06B6D4 100%);
    --gradient-accent: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
    --gradient-hero: linear-gradient(135deg, #0F172A 0%, #1E40AF 50%, #06B6D4 100%);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--white);
    color: var(--text-gray);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; line-height: 1.2; }
h2 { font-size: 2.5rem; line-height: 1.3; }
h3 { font-size: 2rem; line-height: 1.4; }
h4 { font-size: 1.5rem; line-height: 1.5; }
h5 { font-size: 1.25rem; line-height: 1.5; }
h6 { font-size: 1rem; line-height: 1.5; }

p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--gold);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
   HEADER & NAVIGATION
   ============================================= */

.site-header {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.header-top {
    background: var(--light-gray);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-contact {
    display: flex;
    gap: 25px;
    align-items: center;
}

.header-contact a {
    color: var(--text-gray);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.header-contact a:hover {
    color: var(--primary-blue);
    transform: translateY(-2px);
}

.header-contact i {
    font-size: 1rem;
    color: var(--accent-cyan);
}

.header-main {
    padding: 15px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo img {
    height: 60px;
    width: auto;
    transition: var(--transition);
}

.site-logo:hover img {
    transform: scale(1.05);
}

.site-logo h1 {
    color: var(--primary-blue);
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
}

.site-logo .logo-subtitle {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

/* Navigation Menu */
.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--dark-text);
    padding: 12px 20px;
    display: block;
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover {
    background: var(--light-gray);
    color: var(--primary-blue);
    transform: translateY(-2px);
}

.nav-menu a.active {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

/* Shopping Cart Button */
.cart-button {
    background: var(--gradient-accent);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
    transition: var(--transition);
    border: none;
}

.cart-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
    filter: brightness(1.1);
}

.cart-button i {
    font-size: 1.3rem;
}

.cart-count {
    background: var(--white);
    color: var(--accent-cyan);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: var(--primary-blue);
    border: none;
    color: var(--white);
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--secondary-blue);
    transform: scale(1.05);
}

/* =============================================
   FOOTER
   ============================================= */

.site-footer {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    color: var(--white);
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-section p {
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.85);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section ul li a:hover {
    color: var(--gold);
    padding-right: 10px;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    direction: ltr;
}

.footer-social a {
    background: rgba(6, 182, 212, 0.15);
    border: 2px solid rgba(6, 182, 212, 0.3);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #22D3EE;
    font-size: 1.4rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.footer-social a i {
    color: #22D3EE !important;
    font-size: 1.5rem !important;
    display: inline-block !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    font-style: normal !important;
    font-weight: 400 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-family: "Font Awesome 6 Brands", "Font Awesome 6 Free", "FontAwesome" !important;
    text-rendering: auto !important;
}

.footer-social a:hover {
    background: linear-gradient(135deg, #06B6D4, #10B981);
    border-color: transparent;
    color: var(--white);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
}

.footer-social a:hover i {
    color: var(--white);
}

/* Fallback: show initials if icons are blocked/not loaded */
.footer-social a { position: relative; }
.footer-social a::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #22D3EE;
}
.footer-social a[aria-label="Facebook"]::after { content: 'f'; }
.footer-social a[aria-label="Instagram"]::after { content: '◎'; }
.footer-social a[aria-label="YouTube"]::after { content: '▶'; }
.footer-social a[aria-label="WhatsApp"]::after { content: '☎'; }

/* When icon fonts render, keep them above fallback */
.footer-social a i { position: relative; z-index: 1; }

.footer-social a:hover::after { color: var(--white); }

/* Individual Social Colors on Hover */
.footer-social a:nth-child(1):hover {
    background: #1877F2; /* Facebook Blue */
}

.footer-social a:nth-child(2):hover {
    background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); /* Instagram Gradient */
}

.footer-social a:nth-child(3):hover {
    background: #FF0000; /* YouTube Red */
}

.footer-social a:nth-child(4):hover {
    background: #25D366; /* WhatsApp Green */
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.footer-bottom a {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
    display: inline-block;
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

/* =============================================
   SECTIONS
   ============================================= */

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-weight: 800;
}

.section-title .subtitle {
    color: var(--text-gray);
    font-size: 1.3rem;
    font-weight: 400;
}

.section-title .line {
    width: 100px;
    height: 4px;
    background: var(--gradient-accent);
    margin: 20px auto;
    border-radius: 2px;
}

/* =============================================
   CARDS
   ============================================= */

.card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.card-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.card-body {
    padding: 25px;
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-weight: 700;
}

.card-text {
    color: var(--text-gray);
    margin-bottom: 20px;
    line-height: 1.7;
}

/* =============================================
   FORMS
   ============================================= */

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* =============================================
   ACCESSIBILITY WIDGET
   ============================================= */

.accessibility-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.accessibility-toggle {
    background: var(--white);
    color: var(--primary-blue);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border: 3px solid var(--primary-blue);
}

.accessibility-toggle:hover {
    background: var(--gradient-primary);
    color: var(--white);
    transform: scale(1.1);
    border-color: transparent;
}

.accessibility-toggle i {
    font-size: 1.5rem;
}

/* Accessibility Panel */
.accessibility-panel[hidden] { display: none; }
.accessibility-panel {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 10000;
}
.accessibility-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #06B6D4, #10B981);
    color: #fff;
}
.accessibility-header h3 { font-size: 1.1rem; margin: 0; }
.accessibility-close { background: transparent; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.accessibility-body { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.accessibility-body button {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    font-weight: 600;
}
.accessibility-body button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.accessibility-body .reset { grid-column: span 2; background: #F3F4F6; }
.accessibility-body .legal-link { grid-column: span 2; text-align: center; padding: 10px; border-radius: 8px; background: #F9FAFB; display: block; font-weight: 700; color: var(--primary-blue); border: 1px solid var(--border-color); }

/* Effects applied by widget */
.a11y-contrast { filter: contrast(1.3) saturate(1.1); }
.a11y-grayscale { filter: grayscale(1); }
.a11y-highlight-links a { outline: 2px dashed #10B981; outline-offset: 2px; }
.a11y-readable-font { font-family: Arial, Helvetica, sans-serif !important; }
.a11y-keyboard-outline *:focus { outline: 3px solid #06B6D4 !important; outline-offset: 2px; }

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 1024px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    
    .nav-menu {
        gap: 3px;
    }
    
    .nav-menu a {
        padding: 10px 15px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--primary-blue);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
    }
    
    .main-nav.active {
        display: flex;
        background: var(--white);
        border-top: 1px solid var(--border-color);
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu a {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    
    .header-contact {
        flex-direction: column;
        gap: 10px;
    }
    
    .site-logo h1 {
        font-size: 1.5rem;
    }
    
    .site-logo img {
        height: 50px;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .site-logo h1 {
        font-size: 1.2rem;
    }
    
    .site-logo img {
        height: 40px;
    }
    
    .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* =============================================
   UTILITIES
   ============================================= */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mt-4 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 3rem; }

.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 2rem; }
.pt-4 { padding-top: 3rem; }

.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 2rem; }
.pb-4 { padding-bottom: 3rem; }

