/* Universal Device Support CSS - iOS, Android, Tablets, Desktops */

/* ===== iOS SAFARI SPECIFIC FIXES ===== */
/* Safe area support for iPhone X and newer */
@supports (padding: max(0px)) {
    .container, .navbar, .footer {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .hero-section, .section {
        padding-top: max(2rem, env(safe-area-inset-top));
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
    
    /* Mobile navigation adjustments for iOS */
    .navbar {
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }
}

/* iOS Safari viewport height fix */
@supports (-webkit-touch-callout: none) {
    .hero-section, .section-fullscreen {
        min-height: -webkit-fill-available;
        height: 100vh;
    }
}

/* iOS input styling fixes */
input, textarea, select {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    background: transparent;
}

input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="tel"],
textarea {
    -webkit-appearance: none;
    -webkit-border-radius: 0;
    border-radius: 8px;
}

/* iOS button fixes */
button, .btn {
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

/* ===== ANDROID CHROME SPECIFIC FIXES ===== */
/* Android Chrome smooth scrolling */
html {
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

/* Android input styling */
input:focus, textarea:focus, select:focus {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* ===== TABLET SUPPORT ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
    
    .hero-section {
        padding: 100px 0;
    }
    
    .section {
        padding: 80px 0;
    }
    
    /* iPad landscape adjustments */
    @media (orientation: landscape) {
        .hero-section {
            padding: 60px 0;
        }
        
        .navbar-nav {
            display: flex;
            flex-direction: row;
        }
    }
}

/* ===== DESSKTOP SUPPORT ===== */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-section {
        padding: 140px 0;
    }
    
    .section {
        padding: 120px 0;
    }
}

/* ===== UNIVERSAL RESPONSIVE BREAKPOINTS ===== */

/* Extra small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    .hero-title {
        font-size: 2rem !important;
    }
    
    .section-title {
        font-size: 1.8rem !important;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    /* iOS small screen adjustments */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.9rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
}

/* ===== UNIVERSAL TOUCH SUPPORT ===== */
/* Touch-friendly tap targets */
.btn, .nav-link, .card-link {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Remove hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .nav-link:hover {
        transform: none;
    }
}

/* ===== ACCESSIBILITY AND UNIVERSAL DESIGN ===== */
/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid currentColor;
    }
}

/* 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 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f172a;
        color: #ffffff;
    }
    
    .card {
        background-color: #1e293b;
        color: #ffffff;
    }
    
    .navbar {
        background-color: #1e293b !important;
    }
}

/* ===== PWA INSTALL PROMPT SUPPORT ===== */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #fbbf24, #0ea5e9);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
}

.pwa-install-prompt.show {
    display: block;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ===== NOTCH AND DEVICE SPECIFIC FIXES ===== */
/* iPhone X and newer notch support */
@supports (padding: max(0px)) {
    .notch-aware {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Landscape orientation fixes */
@media (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: 60px 0;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
}

/* ===== FONT AND TEXT SCALING ===== */
/* Prevent text overflow on small screens */
.text-responsive {
    font-size: clamp(0.875rem, 2vw, 1.125rem);
}

.title-responsive {
    font-size: clamp(1.5rem, 5vw, 3rem);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
/* Hardware acceleration for smooth scrolling */
.smooth-scroll {
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimize images for all devices */
.img-responsive {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* ===== BROWSER SPECIFIC FIXES ===== */
/* Safari specific fixes */
_::-webkit-full-page-media, _:future, :root, .safari-only {
    /* Safari specific styles */
}

/* Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) {
    /* Chrome specific styles */
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    /* Firefox specific styles */
}
