/* Contrast and Accessibility Enhancements for MaxMedia Website */

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #FFD700 !important;
        --secondary-color: #FFA500 !important;
        --dark-color: #000000 !important;
        --light-dark: #333333 !important;
    }
    
    .btn-primary {
        background: #000000 !important;
        color: #FFD700 !important;
        border: 3px solid #FFD700 !important;
    }
    
    .btn-secondary {
        background: #FFD700 !important;
        color: #000000 !important;
        border: 3px solid #000000 !important;
    }
    
    .service-card,
    .portfolio-item,
    .partner-item {
        border: 3px solid #FFD700 !important;
    }
}

/* Focus Indicators for Keyboard Navigation */
.nav-menu a:focus,
.btn:focus,
.filter-btn:focus,
input:focus,
textarea:focus,
.service-card:focus,
.portfolio-item:focus {
    outline: 3px solid #FFD700;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(255, 215, 0, 0.3);
}

/* Skip Link Styling */
.skip-link:focus {
    background: #FFD700 !important;
    color: #000000 !important;
    font-weight: bold;
    padding: 12px 16px;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Enhanced Button States */
.btn:hover,
.btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4),
                0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3),
                0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Text Readability Improvements */
.hero-title {
    font-weight: 800;
}

.hero-subtitle {
    font-weight: 600;
}

/* Card Hover States */
.service-card:hover,
.portfolio-item:hover,
.partner-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(255, 215, 0, 0.25);
    border-color: #FFD700;
}

/* Form Field Enhancements */
.form-group input,
.form-group textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    border-width: 2px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
    transform: scale(1.02);
}

/* Navigation Enhancements */
.nav-menu a {
    position: relative;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a:focus {
    background: rgba(255, 215, 0, 0.1);
    color: #1a1a1a;
}

/* Mobile Menu Improvements */
@media (max-width: 768px) {
    .nav-menu {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        border-left: 4px solid #FFD700;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu a {
        padding: 16px 24px;
        border-bottom: 1px solid rgba(255, 215, 0, 0.2);
        font-size: 18px;
    }
    
    .hero-content {
        padding: 2rem 1rem;
        margin: 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
        text-shadow: 3px 3px 6px rgba(255, 255, 255, 0.9), 
                     -1px -1px 2px rgba(255, 215, 0, 0.6);
    }
    
    .hero-subtitle {
        font-size: 1rem;
        text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8),
                     -1px -1px 2px rgba(255, 215, 0, 0.4);
    }
    
    .hamburger span {
        background: #1a1a1a;
        height: 3px;
        border-radius: 2px;
    }
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error States */
.form-group.error input,
.form-group.error textarea {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    font-weight: 500;
}

/* Success States */
.form-group.success input,
.form-group.success textarea {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Optimizations */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .header,
    .btn,
    .social-links,
    .hamburger {
        display: none !important;
    }
    
    .hero-title,
    .section-header h2 {
        color: black !important;
        page-break-after: avoid;
    }
    
    .service-card,
    .portfolio-item {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }
}

/* Screen Reader Only Content */
.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;
}

/* Custom Properties for Dynamic Theming */
:root {
    --shadow-light: 0 2px 10px rgba(255, 215, 0, 0.1);
    --shadow-medium: 0 5px 20px rgba(255, 215, 0, 0.2);
    --shadow-heavy: 0 10px 30px rgba(255, 215, 0, 0.3);
    --border-radius: 8px;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-dark { color: var(--dark-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-dark { background-color: var(--dark-color) !important; }
.shadow-light { box-shadow: var(--shadow-light) !important; }
.shadow-medium { box-shadow: var(--shadow-medium) !important; }
.shadow-heavy { box-shadow: var(--shadow-heavy) !important; }
/* Font Family Consistency for Forms and Buttons */
.btn, .filter-btn, input, textarea, button, select {
    font-family: 'Cairo', sans-serif !important;
}

/* Form elements font consistency */
.form-group input,
.form-group textarea {
    font-family: 'Cairo', sans-serif !important;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    font-family: 'Cairo', sans-serif !important;
}

/* Portfolio filter buttons font */
.portfolio-filter .filter-btn {
    font-family: 'Cairo', sans-serif !important;
}

/* Contact form button */
.contact-form .btn {
    font-family: 'Cairo', sans-serif !important;
}

/* Ensure all interactive elements use Cairo */
button[type="submit"],
input[type="submit"],
input[type="button"] {
    font-family: 'Cairo', sans-serif !important;
}