/**
 * Theme Name: SarkarHealings Pro - Optimized Child Theme
 * Theme URI: https://sarkarhealings.com/
 * Description: Advanced SEO-optimized child theme for SarkarHealings with performance enhancements, Core Web Vitals optimization, and Islamic spiritual healing features
 * Author: SarkarHealings Development Team
 * Author URI: https://sarkarhealings.com
 * Template: astra
 * Version: 2.0.0
 * Text Domain: sarkarhealings-child
 * License: GPL v2 or later
 */

/* ==========================================================================
   Table of Contents
   ========================================================================== */
/*
   1. CSS Variables & Custom Properties
   2. Performance Optimizations
   3. Typography & Readability
   4. Core Web Vitals Fixes
   5. Mobile Optimizations
   6. Header & Navigation
   7. Hero Sections
   8. Service Cards
   9. Testimonials
   10. Islamic Design Elements
   11. Forms & CTAs
   12. Footer Enhancements
   13. Accessibility
   14. Print Styles
*/

/* ==========================================================================
   1. CSS Variables & Custom Properties
   ========================================================================== */
:root {
    /* Brand Colors */
    --sh-primary: #2E7D32;        /* Islamic Green */
    --sh-secondary: #1976D2;      /* Trust Blue */
    --sh-accent: #FFB300;         /* Golden */
    --sh-dark: #1A237E;           /* Deep Blue */
    --sh-light: #F5F5F5;
    --sh-white: #FFFFFF;
    
    /* Semantic Colors */
    --sh-success: #4CAF50;
    --sh-warning: #FF9800;
    --sh-error: #F44336;
    --sh-info: #2196F3;
    
    /* Typography */
    --sh-font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --sh-font-arabic: 'Noto Naskh Arabic', 'Arabic Typesetting', serif;
    --sh-font-heading: 'Playfair Display', Georgia, serif;
    
    /* Spacing */
    --sh-spacing-xs: 0.25rem;
    --sh-spacing-sm: 0.5rem;
    --sh-spacing-md: 1rem;
    --sh-spacing-lg: 2rem;
    --sh-spacing-xl: 4rem;
    
    /* Shadows */
    --sh-shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --sh-shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --sh-shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    
    /* Transitions */
    --sh-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --sh-radius-sm: 4px;
    --sh-radius-md: 8px;
    --sh-radius-lg: 16px;
}

/* ==========================================================================
   2. Performance Optimizations
   ========================================================================== */

/* Critical CSS - Above the fold content */
.sh-critical {
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
}

/* Font Display Swap for Web Fonts */
@font-face {
    font-family: 'Playfair Display';
    font-display: swap;
    src: local('Playfair Display'), 
         url('../fonts/playfair-display.woff2') format('woff2');
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   3. Typography & Readability
   ========================================================================== */

body {
    font-family: var(--sh-font-primary);
    font-size: 18px;
    line-height: 1.7;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Arabic Text Support */
.arabic-text {
    font-family: var(--sh-font-arabic);
    font-size: 1.1em;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
}

/* Heading Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--sh-font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--sh-spacing-md);
}

h1 { 
    font-size: clamp(2rem, 5vw, 3.5rem); 
    color: var(--sh-dark);
}

h2 { 
    font-size: clamp(1.75rem, 4vw, 2.5rem); 
    color: var(--sh-primary);
}

h3 { 
    font-size: clamp(1.5rem, 3vw, 2rem); 
}

/* Improved Readability */
.content-area p {
    margin-bottom: 1.5em;
    max-width: 75ch;
}

/* ==========================================================================
   4. Core Web Vitals Fixes
   ========================================================================== */

/* Prevent Layout Shift */
img, video, iframe {
    aspect-ratio: attr(width) / attr(height);
    max-width: 100%;
    height: auto;
}

/* Reserve Space for Dynamic Content */
.sh-hero-section {
    min-height: 600px;
    contain: layout;
}

/* Optimize Input Delay */
a, button, input, select, textarea {
    touch-action: manipulation;
}

/* Lazy Loading Placeholder */
.sh-lazy-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   5. Mobile Optimizations
   ========================================================================== */

/* Mobile First Approach */
@media (max-width: 768px) {
    /* Improved Touch Targets */
    .sh-button,
    .sh-cta,
    button,
    input[type="submit"] {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 24px;
    }
    
    /* Mobile Navigation */
    .sh-mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--sh-white);
        box-shadow: var(--sh-shadow-lg);
        transition: left 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
    }
    
    .sh-mobile-menu.active {
        left: 0;
    }
    
    /* Mobile Typography */
    body {
        font-size: 16px;
    }
    
    /* Stack Elements on Mobile */
    .sh-grid {
        grid-template-columns: 1fr !important;
        gap: var(--sh-spacing-md);
    }
    
    /* Mobile-Optimized Forms */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================================================
   6. Header & Navigation
   ========================================================================== */

.sh-header {
    background: var(--sh-white);
    box-shadow: var(--sh-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--sh-transition);
}

/* Scrolled State */
.sh-header.scrolled {
    box-shadow: var(--sh-shadow-md);
    padding: 10px 0;
}

/* Navigation Menu */
.sh-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sh-spacing-md) 0;
}

.sh-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--sh-spacing-lg);
}

.sh-nav-link {
    color: var(--sh-dark);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--sh-transition);
}

.sh-nav-link:hover {
    color: var(--sh-primary);
}

.sh-nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--sh-primary);
    transition: width 0.3s ease;
}

.sh-nav-link:hover::after {
    width: 100%;
}

/* ==========================================================================
   7. Hero Sections
   ========================================================================== */

.sh-hero {
    background: linear-gradient(135deg, var(--sh-primary) 0%, var(--sh-dark) 100%);
    color: var(--sh-white);
    padding: var(--sh-spacing-xl) 0;
    position: relative;
    overflow: hidden;
}

/* Islamic Pattern Overlay */
.sh-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><pattern id="islamic" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.1)"/></pattern><rect width="100" height="100" fill="url(%23islamic)"/></svg>');
    opacity: 0.3;
}

.sh-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.sh-hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: var(--sh-spacing-md);
    animation: fadeInUp 0.8s ease;
}

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

/* ==========================================================================
   8. Service Cards
   ========================================================================== */

.sh-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--sh-spacing-lg);
    padding: var(--sh-spacing-xl) 0;
}

.sh-service-card {
    background: var(--sh-white);
    border-radius: var(--sh-radius-lg);
    padding: var(--sh-spacing-lg);
    box-shadow: var(--sh-shadow-sm);
    transition: var(--sh-transition);
    position: relative;
    overflow: hidden;
}

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

.sh-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--sh-primary), var(--sh-secondary));
}

.sh-service-icon {
    width: 60px;
    height: 60px;
    background: var(--sh-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sh-spacing-md);
    font-size: 24px;
    color: var(--sh-white);
}

.sh-service-title {
    font-size: 1.5rem;
    margin-bottom: var(--sh-spacing-sm);
    color: var(--sh-dark);
}

.sh-service-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: var(--sh-spacing-md);
}

.sh-service-link {
    color: var(--sh-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--sh-spacing-xs);
    transition: var(--sh-transition);
}

.sh-service-link:hover {
    gap: var(--sh-spacing-sm);
}

/* ==========================================================================
   9. Testimonials
   ========================================================================== */

.sh-testimonials {
    background: var(--sh-light);
    padding: var(--sh-spacing-xl) 0;
}

.sh-testimonial-card {
    background: var(--sh-white);
    padding: var(--sh-spacing-lg);
    border-radius: var(--sh-radius-md);
    box-shadow: var(--sh-shadow-sm);
    position: relative;
    margin-bottom: var(--sh-spacing-lg);
}

.sh-testimonial-card::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 80px;
    color: var(--sh-primary);
    opacity: 0.2;
    font-family: Georgia, serif;
}

.sh-testimonial-text {
    font-style: italic;
    color: #555;
    margin-bottom: var(--sh-spacing-md);
    line-height: 1.8;
}

.sh-testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--sh-spacing-md);
}

.sh-testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.sh-testimonial-info {
    flex: 1;
}

.sh-testimonial-name {
    font-weight: 600;
    color: var(--sh-dark);
    margin-bottom: 2px;
}

.sh-testimonial-location {
    color: #999;
    font-size: 0.9em;
}

/* Star Rating */
.sh-rating {
    color: var(--sh-accent);
    margin-bottom: var(--sh-spacing-sm);
}

/* ==========================================================================
   10. Islamic Design Elements
   ========================================================================== */

/* Bismillah Header */
.sh-bismillah {
    text-align: center;
    font-family: var(--sh-font-arabic);
    font-size: 1.5rem;
    color: var(--sh-primary);
    margin: var(--sh-spacing-lg) 0;
    position: relative;
}

.sh-bismillah::before,
.sh-bismillah::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--sh-primary), transparent);
}

.sh-bismillah::before {
    left: 0;
}

.sh-bismillah::after {
    right: 0;
}

/* Islamic Geometric Pattern */
.sh-pattern-bg {
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(46, 125, 50, 0.03) 10px,
            rgba(46, 125, 50, 0.03) 20px
        );
}

/* Quranic Verse Display */
.sh-verse {
    background: linear-gradient(135deg, var(--sh-primary), var(--sh-dark));
    color: var(--sh-white);
    padding: var(--sh-spacing-lg);
    border-radius: var(--sh-radius-md);
    text-align: center;
    margin: var(--sh-spacing-lg) 0;
    position: relative;
    overflow: hidden;
}

.sh-verse-arabic {
    font-family: var(--sh-font-arabic);
    font-size: 1.8rem;
    line-height: 2.2;
    margin-bottom: var(--sh-spacing-md);
}

.sh-verse-translation {
    font-style: italic;
    opacity: 0.9;
}

/* ==========================================================================
   11. Forms & CTAs
   ========================================================================== */

/* Call-to-Action Buttons */
.sh-cta {
    display: inline-block;
    background: var(--sh-primary);
    color: var(--sh-white);
    padding: 14px 32px;
    border-radius: var(--sh-radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: var(--sh-transition);
    box-shadow: var(--sh-shadow-sm);
    position: relative;
    overflow: hidden;
}

.sh-cta:hover {
    background: var(--sh-dark);
    box-shadow: var(--sh-shadow-md);
    transform: translateY(-2px);
}

.sh-cta::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.sh-cta:active::after {
    width: 300px;
    height: 300px;
}

/* WhatsApp CTA */
.sh-whatsapp-cta {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--sh-shadow-lg);
    z-index: 999;
    transition: var(--sh-transition);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.sh-whatsapp-cta:hover {
    transform: scale(1.1);
}

/* Contact Form */
.sh-form {
    max-width: 600px;
    margin: 0 auto;
}

.sh-form-group {
    margin-bottom: var(--sh-spacing-md);
}

.sh-form-label {
    display: block;
    margin-bottom: var(--sh-spacing-xs);
    font-weight: 500;
    color: var(--sh-dark);
}

.sh-form-input,
.sh-form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: var(--sh-radius-sm);
    font-size: 16px;
    transition: var(--sh-transition);
    font-family: inherit;
}

.sh-form-input:focus,
.sh-form-textarea:focus {
    outline: none;
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

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

/* ==========================================================================
   12. Footer Enhancements
   ========================================================================== */

.sh-footer {
    background: var(--sh-dark);
    color: var(--sh-white);
    padding: var(--sh-spacing-xl) 0 var(--sh-spacing-lg);
}

.sh-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--sh-spacing-xl);
    margin-bottom: var(--sh-spacing-xl);
}

.sh-footer-section h3 {
    color: var(--sh-accent);
    margin-bottom: var(--sh-spacing-md);
}

.sh-footer-links {
    list-style: none;
    padding: 0;
}

.sh-footer-links li {
    margin-bottom: var(--sh-spacing-sm);
}

.sh-footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--sh-transition);
}

.sh-footer-links a:hover {
    color: var(--sh-accent);
    padding-left: 5px;
}

/* Social Media Icons */
.sh-social-icons {
    display: flex;
    gap: var(--sh-spacing-md);
    margin-top: var(--sh-spacing-md);
}

.sh-social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sh-white);
    transition: var(--sh-transition);
}

.sh-social-icon:hover {
    background: var(--sh-primary);
    transform: translateY(-3px);
}

/* ==========================================================================
   13. Accessibility
   ========================================================================== */

/* Skip to Content Link */
.sh-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--sh-primary);
    color: var(--sh-white);
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

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

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

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .sh-cta {
        border: 2px solid currentColor;
    }
}

/* ==========================================================================
   14. Print Styles
   ========================================================================== */

@media print {
    /* Hide non-essential elements */
    .sh-header,
    .sh-footer,
    .sh-whatsapp-cta,
    .sh-social-icons,
    .sh-nav {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    /* Ensure content breaks properly */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   Additional Utility Classes
   ========================================================================== */

/* Spacing Utilities */
.sh-mt-0 { margin-top: 0 !important; }
.sh-mt-1 { margin-top: var(--sh-spacing-sm) !important; }
.sh-mt-2 { margin-top: var(--sh-spacing-md) !important; }
.sh-mt-3 { margin-top: var(--sh-spacing-lg) !important; }
.sh-mt-4 { margin-top: var(--sh-spacing-xl) !important; }

.sh-mb-0 { margin-bottom: 0 !important; }
.sh-mb-1 { margin-bottom: var(--sh-spacing-sm) !important; }
.sh-mb-2 { margin-bottom: var(--sh-spacing-md) !important; }
.sh-mb-3 { margin-bottom: var(--sh-spacing-lg) !important; }
.sh-mb-4 { margin-bottom: var(--sh-spacing-xl) !important; }

/* Text Utilities */
.sh-text-center { text-align: center !important; }
.sh-text-left { text-align: left !important; }
.sh-text-right { text-align: right !important; }

/* Visibility Utilities */
.sh-hide-mobile {
    @media (max-width: 768px) {
        display: none !important;
    }
}

.sh-hide-desktop {
    @media (min-width: 769px) {
        display: none !important;
    }
}

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

/* Grid System */
.sh-grid {
    display: grid;
    gap: var(--sh-spacing-lg);
}

.sh-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.sh-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.sh-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .sh-grid-2,
    .sh-grid-3,
    .sh-grid-4 {
        grid-template-columns: 1fr;
    }
}