/* ==============================================
   MEAFFC Arabic Website Styles (RTL)
   Modern, Professional Design
   ============================================== */

/* CSS Variables for consistent theming */
:root {
    /* Primary Colors */
    --primary-color: #FF6B35;
    --primary-dark: #E55A2B;
    --secondary-color: #2E86AB;
    --accent-color: #F18F01;
    
    /* UI Colors */
    --background-light: #FFFFFF;
    --background-dark: #1A1A1A;
    --surface-light: #F8F9FA;
    --surface-dark: #2D2D2D;
    
    /* Text Colors */
    --text-primary: #2D3748;
    --text-secondary: #718096;
    --text-muted: #A0AEC0;
    --text-white: #FFFFFF;
    
    /* Accent Colors */
    --success-color: #38A169;
    --warning-color: #ED8936;
    --error-color: #E53E3E;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transitions */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-light);
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--surface-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.nav-menu {
    display: flex;
    gap: var(--spacing-xl);
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(255, 107, 53, 0.1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    padding: calc(70px + var(--spacing-2xl)) 0 var(--spacing-2xl);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

.hero-description {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-2xl);
    opacity: 0.8;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: center;
    animation: fadeInRight 1s ease-out 0.3s both;
}

.app-mockup {
    position: relative;
    transform: perspective(1000px) rotateY(-15deg) rotateX(5deg);
    transition: transform var(--transition-slow);
}

.app-mockup:hover {
    transform: perspective(1000px) rotateY(-10deg) rotateX(2deg);
}

.phone-frame {
    width: 280px;
    height: 560px;
    background: linear-gradient(145deg, #2D3748, #4A5568);
    border-radius: 30px;
    padding: 20px;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background-color: #CBD5E0;
    border-radius: 3px;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #F7FAFC, #EDF2F7);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.app-interface {
    padding: var(--spacing-lg);
    height: 100%;
    color: var(--text-primary);
}

.app-header {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md) 0;
    border-bottom: 2px solid var(--primary-color);
}

.app-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.feature-item {
    background-color: var(--background-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    transition: transform var(--transition-fast);
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Sections */
section {
    padding: var(--spacing-2xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-sm);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    background-color: var(--surface-light);
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
}

.about-card {
    background-color: var(--background-light);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform var(--transition-normal);
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
}

.about-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
}

.about-card p {
    font-size: 1.125rem;
    line-height: 1.8;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.feature-card {
    background-color: var(--background-light);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    display: block;
}

.feature-card h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
}

.feature-card p {
    font-size: 1rem;
    line-height: 1.7;
}

/* Privacy and Terms Sections */
.privacy, .terms {
    background-color: var(--surface-light);
}

.policy-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--background-light);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.policy-section {
    margin-bottom: var(--spacing-2xl);
}

.policy-section h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-color);
}

.policy-section p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
}

.policy-section ul {
    list-style: none;
    padding: 0;
    margin-bottom: var(--spacing-md);
}

.policy-section li {
    position: relative;
    padding: var(--spacing-sm) 0 var(--spacing-sm) var(--spacing-xl);
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.policy-section li::before {
    content: '✓';
    position: absolute;
    right: 0;
    top: var(--spacing-sm);
    color: var(--primary-color);
    font-weight: bold;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
}

.contact-info {
    background-color: var(--surface-light);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
}

.contact-info h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xl);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-lg);
}

.contact-icon {
    font-size: 1.5rem;
    background-color: var(--primary-color);
    color: var(--text-white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item h4 {
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
}

.contact-item p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Contact Form */
.contact-form {
    background-color: var(--background-light);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.contact-form h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.form-group {
    position: relative;
    margin-bottom: var(--spacing-xl);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-md);
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
    background-color: var(--background-light);
    direction: rtl;
    text-align: right;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group label {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-md);
    color: var(--text-secondary);
    pointer-events: none;
    transition: all var(--transition-fast);
    font-size: 1rem;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -10px;
    right: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--primary-color);
    background-color: var(--background-light);
    padding: 0 var(--spacing-sm);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: var(--spacing-sm);
    display: block;
}

.success-message {
    background-color: #F0FDF4;
    border: 1px solid var(--success-color);
    color: var(--success-color);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    text-align: center;
    margin-top: var(--spacing-lg);
}

/* Footer */
.footer {
    background-color: var(--surface-dark);
    color: var(--text-white);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

.footer-logo h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.footer-logo p {
    color: var(--text-muted);
    font-size: 1rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
}

.footer-column h4 {
    color: var(--text-white);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
}

.footer-column a {
    display: block;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    transition: color var(--transition-fast);
}

.footer-column a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid #4A5568;
}

.footer-bottom p {
    color: var(--text-muted);
    margin: 0;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* Navigation Mobile */
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: var(--spacing-2xl);
        transition: right var(--transition-normal);
        box-shadow: var(--shadow-md);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-link {
        font-size: 1.125rem;
        padding: var(--spacing-lg);
        width: 80%;
        text-align: center;
        border-radius: var(--radius-lg);
        margin-bottom: var(--spacing-md);
    }
    
    /* Hero Mobile */
    .hero {
        padding: calc(70px + var(--spacing-lg)) 0 var(--spacing-lg);
        min-height: auto;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .phone-frame {
        width: 240px;
        height: 480px;
    }
    
    /* Sections Mobile */
    .section-title {
        font-size: 2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Mobile */
    .contact-item {
        flex-direction: column;
        text-align: center;
    }
    
    /* General Mobile */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    section {
        padding: var(--spacing-xl) 0;
    }
    
    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .phone-frame {
        width: 200px;
        height: 400px;
        padding: 15px;
    }
    
    .policy-content,
    .contact-form,
    .contact-info {
        padding: var(--spacing-lg);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .back-to-top,
    .loading-screen {
        display: none !important;
    }
    
    .hero {
        padding-top: 0;
    }
    
    * {
        color: #000 !important;
        background: #fff !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --background-light: #FFFFFF;
        --surface-light: #F0F0F0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Selection Styles */
::selection {
    background-color: var(--primary-color);
    color: var(--text-white);
}

::-moz-selection {
    background-color: var(--primary-color);
    color: var(--text-white);
}
