/* Common CSS Variables and Base Styles for Arabic Hub Education */
:root {
    --primary-color: #1a936f;
    --secondary-color: #ff6b6b;
    --accent-color: #4ecdc4;
    --light-color: #f7f9f9;
    --dark-color: #264653;
    --text-color: #2d3748;
    --heading-color: #1a202c;
    --background-color: #f1faee;
    --card-bg: #ffffff;
    --definition-bg: #e9f5f3;
    --border-color: #a8dadc;
    --table-even-bg: #f7f9f9;
    --table-hover-bg: #e9f5f3;
    --border-radius: 12px;
    --box-shadow: 0 6px 16px rgba(26, 147, 111, 0.12);
    --gradient-primary: linear-gradient(135deg, #1a936f 0%, #16855f 100%);
    --gradient-secondary: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    --gradient-accent: linear-gradient(135deg, #4ecdc4 0%, #1a936f 100%);
    --gradient-light: linear-gradient(135deg, #f1faee 0%, #e9f5f3 100%);
}

[data-theme="dark"] {
    --primary-color: #2a9d8f;
    --secondary-color: #e76f51;
    --accent-color: #4ecdc4;
    --light-color: #264653;
    --dark-color: #1a1a2e;
    --text-color: #e9ecef;
    --heading-color: #f8f9fa;
    --background-color: #1a1a2e;
    --card-bg: #264653;
    --definition-bg: #1a4d5f;
    --border-color: #457b9d;
    --table-even-bg: #264653;
    --table-hover-bg: #2a9d8f;
    --box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #2a9d8f 0%, #1a936f 100%);
    --gradient-secondary: linear-gradient(135deg, #e76f51 0%, #ff6b6b 100%);
    --gradient-accent: linear-gradient(135deg, #4ecdc4 0%, #2a9d8f 100%);
    --gradient-light: linear-gradient(135deg, #264653 0%, #1a1a2e 100%);
    --definition-text: #f8f9fa;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* RTL/LTR Support */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.ltr {
    direction: ltr;
    text-align: left;
}

/* Header Styles */
.ArabicH-general-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 3rem 0;
    box-shadow: var(--box-shadow);
    border-bottom: 4px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.ArabicH-general-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.ArabicH-general-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.ArabicH-general-logo-container {
    display: flex;
    align-items: center;
}

.ArabicH-general-logo {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
    cursor: pointer;
    border-radius: 50%;
    background: white;
    padding: 5px;
}

.ArabicH-general-logo:hover {
    transform: scale(1.05);
}

.ArabicH-general-title-container {
    text-align: center;
}

.ArabicH-general-title-container h1 {
    font-size: 2.8rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin: 0;
    background: linear-gradient(45deg, #ffffff, #e0f7fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ArabicH-general-header-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
    justify-content: flex-start;
}

.rtl .ArabicH-general-header-controls {
    justify-content: flex-end;
}

.ArabicH-general-theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ArabicH-theme-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.ArabicH-theme-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.rtl .ArabicH-theme-toggle-switch {
    margin-right: 0;
    margin-left: 10px;
}

.ArabicH-theme-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ArabicH-theme-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.ArabicH-theme-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    right: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .ArabicH-theme-toggle-slider {
    background-color: var(--secondary-color);
}

input:checked + .ArabicH-theme-toggle-slider:before {
    transform: translateX(-26px);
}

.ArabicH-general-language-selector {
    position: relative;
}

.ArabicH-general-language-dropdown {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    min-width: 120px;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
}

.ArabicH-general-language-dropdown option {
    background-color: var(--primary-color);
    color: white;
}

.ArabicH-general-language-dropdown:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Windows Bar Styles */
.ArabicH-windows-bar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    justify-content: center;
}

[data-theme="dark"] .ArabicH-windows-bar {
    background: rgba(45, 52, 54, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ArabicH-window-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    border: 1px solid transparent;
}

.ArabicH-window-item:hover {
    background: rgba(26, 147, 111, 0.1);
    color: var(--primary-color);
    border-color: var(--border-color);
}

.ArabicH-window-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.ArabicH-window-icon {
    font-size: 1.1rem;
}

/* Footer Styles */
.ArabicH-general-footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-color) 100%);
    color: white;
    margin-top: 3rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.ArabicH-general-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.ArabicH-general-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.ArabicH-general-footer-column h4 {
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.ArabicH-general-footer-column p {
    margin: 0.3rem 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.ArabicH-general-footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ArabicH-general-footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
    padding: 0.15rem 0;
    font-size: 0.9rem;
}

.ArabicH-general-footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: translateX(-5px);
}

.rtl .ArabicH-general-footer-links a:hover {
    transform: translateX(5px);
}

.ArabicH-general-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 2rem;
    text-align: center;
    background: rgba(0,0,0,0.1);
}

.ArabicH-general-footer-bottom p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* PWA Install Button */
.ArabicH-pwa-install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    z-index: 1000;
    transition: all 0.3s ease;
}

.rtl .ArabicH-pwa-install-btn {
    right: auto;
    left: 20px;
}

.ArabicH-pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.ArabicH-pwa-install-icon {
    font-size: 1.2rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive styles */
@media (max-width: 768px) {
    .ArabicH-windows-bar {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .ArabicH-window-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .ArabicH-general-header-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .ArabicH-general-header-controls {
        justify-content: center;
    }
    
    .ArabicH-general-title-container h1 {
        font-size: 2rem;
    }
    
    .ArabicH-general-logo {
        width: 65px;
        height: 65px;
    }
    
    .ArabicH-general-footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem 1rem 1rem;
        gap: 1.5rem;
    }
    
    .ArabicH-general-footer-links {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .ArabicH-general-title-container h1 {
        font-size: 2rem;
    }
    
    .ArabicH-general-logo {
        width: 55px;
        height: 55px;
    }
    
    .ArabicH-general-header-controls {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Year Sections Grid - Updated for horizontal scrolling */
.ArabicH-year-sections {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1rem 0.5rem 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    &::-webkit-scrollbar {
        height: 8px;
    }
    
    &::-webkit-scrollbar-track {
        background: transparent;
        border-radius: 4px;
    }
    
    &::-webkit-scrollbar-thumb {
        background-color: var(--primary-color);
        border-radius: 4px;
    }
    
    /* Smooth scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.ArabicH-year-section {
    flex: 0 0 auto;
    width: 280px;
    min-height: 180px;
    background: var(--definition-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ArabicH-year-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.ArabicH-year-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ArabicH-year-section .ArabicH-coming-soon {
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    margin-top: 0.5rem;
    width: fit-content;
}

/* Dark Mode Fixes for Year Sections */
[data-theme="dark"] .ArabicH-year-section {
    background: var(--definition-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .ArabicH-year-section h3 {
    color: var(--definition-text) !important;
}

[data-theme="dark"] .ArabicH-year-section p {
    color: rgba(248, 249, 250, 0.9) !important;
}

/* Fix for modal year items in dark mode */
[data-theme="dark"] .ArabicH-homepage-year {
    background: var(--definition-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .ArabicH-homepage-year .ArabicH-homepage-year-title {
    color: var(--accent-color) !important;
}

[data-theme="dark"] .ArabicH-homepage-year p {
    color: rgba(248, 249, 250, 0.9) !important;
}

[data-theme="dark"] .ArabicH-card-year {
    background: var(--accent-color);
    color: var(--dark-color) !important;
}

[data-theme="dark"] .ArabicH-coming-soon {
    background: var(--secondary-color);
    color: var(--dark-color) !important;
}

/* Responsive adjustments for year sections */
@media (max-width: 768px) {
    .ArabicH-year-sections {
        gap: 1rem;
        padding: 0.5rem 0.5rem 1.5rem;
    }
    
    .ArabicH-year-section {
        width: 240px;
        min-height: 160px;
        padding: 1.2rem;
    }
    
    .ArabicH-year-section h3 {
        font-size: 1.1rem;
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .ArabicH-year-section {
        width: 220px;
        min-height: 150px;
        padding: 1rem;
    }
    
    .ArabicH-year-section h3 {
        font-size: 1rem;
    }
}

/* Scroll indicator for year sections (optional enhancement) */
.ArabicH-year-sections-container {
    position: relative;
}

.ArabicH-year-sections-container::after {
    content: '→';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0.6;
    animation: bounceRight 2s infinite;
    pointer-events: none;
}

.rtl .ArabicH-year-sections-container::after {
    content: '←';
    right: auto;
    left: 10px;
}

@keyframes bounceRight {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(5px); }
}

.rtl @keyframes bounceRight {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-5px); }
}