/* ==================================
   سطحة الطائف - CSS Styles
   Optimized for Performance & SEO
   ================================== */

/* CSS Variables */
:root {
    --primary-color: #1e3a8a;
    --secondary-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #ffffff;
    --bg-light: #f3f4f6;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-md: 0 5px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --transition-base: all 0.3s ease;
}

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

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

body {
    font-family: 'El Messiri', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--secondary-color);
    color: var(--text-dark);
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* Header Styles - Compact Design */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: var(--text-light);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    will-change: transform;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo i {
    font-size: 1.4rem;
}

.contact-header {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.contact-btn {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-base);
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
}

.contact-btn:hover,
.contact-btn:focus {
    background: var(--secondary-color);
    color: var(--primary-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.whatsapp-btn:hover,
.whatsapp-btn:focus {
    background: #25d366;
    color: white;
    border-color: #25d366;
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    flex: 1;
    justify-content: center;
}

.desktop-nav ul {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.desktop-nav li {
    margin: 0;
}

.desktop-nav a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-base);
    border-radius: 20px;
    white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav a:focus {
    background: rgba(255, 255, 255, 0.15);
    color: var(--secondary-color);
}

/* Mobile Navigation - Hidden on Desktop */
.mobile-nav {
    display: none;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    padding: 0;
}

.mobile-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.mobile-nav li {
    margin: 0;
    flex-shrink: 0;
}

.mobile-nav a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-base);
    white-space: nowrap;
}

.mobile-nav a:hover,
.mobile-nav a:focus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
}

/* Hide scrollbar for mobile nav */
.mobile-nav ul::-webkit-scrollbar {
    display: none;
}

.mobile-nav ul {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(30, 64, 175, 0.95) 100%),
                url('https://sthatna.com/wp-content/uploads/2025/08/IMG-20250801-WA0054.webp') center/cover no-repeat;
    color: var(--text-light);
    padding: 100px 20px;
    text-align: center;
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.hero p {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'El Messiri', sans-serif;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-primary:hover,
.btn-primary:focus {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

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

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Section Styles */
section {
    padding: 80px 20px;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 20px;
    line-height: 1.3;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 100px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

/* Features Section */
.features {
    background: var(--bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    will-change: transform;
}

.feature-card:hover,
.feature-card:focus-within {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    display: inline-block;
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.feature-card p {
    color: #6b7280;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Services Section */
.services {
    background: white;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: var(--text-light);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition-base);
    will-change: transform;
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
    transition: all 0.5s;
    pointer-events: none;
}

.service-card:hover::before {
    top: -20%;
    right: -20%;
}

.service-card:hover,
.service-card:focus-within {
    transform: scale(1.05);
}

.service-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    display: inline-block;
}

.service-card h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    line-height: 1.4;
}

.service-card p {
    line-height: 1.8;
    position: relative;
    z-index: 1;
    font-size: 1.05rem;
}

/* Gallery Section */
.gallery {
    background: var(--bg-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 50px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    aspect-ratio: 4/3;
    background: #e5e7eb;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.gallery-item:hover img,
.gallery-item:focus-within img {
    transform: scale(1.1);
}

/* Map Section */
.map-section {
    background: white;
}

.map-container {
    max-width: 1000px;
    margin: 50px auto 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.map-container iframe {
    width: 100%;
    height: 450px;
    border: none;
    display: block;
}

/* Contact Section */
.contact {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: var(--text-light);
    text-align: center;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.contact-item i {
    font-size: 3rem;
    color: var(--secondary-color);
}

.contact-item a,
.contact-item p {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    transition: var(--transition-base);
}

.contact-item a:hover,
.contact-item a:focus {
    color: var(--secondary-color);
    transform: scale(1.05);
}

/* Footer */
footer {
    background: #111827;
    color: var(--text-light);
    text-align: center;
    padding: 30px 20px;
}

footer p {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

footer .section-title {
    margin-bottom: 0;
    border-bottom: none;
}

footer .section-title::after {
    display: none;
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    left: 30px;
    background-color: #25d366;
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    text-decoration: none;
}

.whatsapp-float:hover,
.whatsapp-float:focus {
    transform: scale(1.1);
    box-shadow: 2px 2px 15px rgba(0,0,0,0.5);
}

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

.animate-fade-in {
    animation: fadeInUp 0.8s ease-out;
}

/* Loading State */
img[loading="lazy"] {
    background: #e5e7eb;
}

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

button:focus,
a:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header,
    .whatsapp-float,
    .cta-buttons {
        display: none;
    }
    
    body {
        color: black;
        background: white;
    }
    
    .section-title {
        page-break-after: avoid;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .features-grid,
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Hide desktop nav, show mobile nav */
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .header-content {
        padding: 10px 15px;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .logo i {
        font-size: 1.2rem;
    }
    
    .contact-header {
        gap: 8px;
    }
    
    .contact-btn {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    .hero {
        padding: 60px 20px;
        min-height: 400px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .cta-buttons {
        gap: 15px;
    }
    
    .features-grid,
    .services-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .contact-info {
        gap: 30px;
    }
    
    section {
        padding: 60px 20px;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 20px;
        left: 20px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 8px 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo i {
        font-size: 1rem;
    }
    
    .contact-btn span {
        display: none;
    }
    
    .contact-btn {
        padding: 6px 8px;
        min-width: 36px;
        justify-content: center;
    }
    
    .contact-btn i {
        font-size: 1.1rem;
        margin: 0;
    }
    
    .mobile-nav a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 25px;
        font-size: 0.95rem;
    }
    
    .feature-card,
    .service-card {
        padding: 30px 20px;
    }
    
    .map-container iframe {
        height: 300px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid var(--text-dark);
    }
    
    .btn-secondary {
        border-width: 3px;
    }
}

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

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f9fafb;
        --bg-light: #1f2937;
    }
}

/* Performance Optimizations */
.feature-card,
.service-card,
.gallery-item {
    contain: layout style paint;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }