/* EloRiser Responsive Design CSS */
/* =============================== */

/* Large Screens (1400px and above) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .boost-requests-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1200px;
        padding: 0 2rem;
    }
    
    .hero-content {
        gap: 4rem;
    }
    
    .hero-image-container {
        width: 350px;
        height: 350px;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .boost-requests-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 3rem;
    }
}

/* Laptop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .container {
        max-width: 1024px;
        padding: 0 2rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-image-container {
        width: 300px;
        height: 300px;
        margin: 0 auto;
    }
    
    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .boost-requests-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .footer-left {
        grid-column: span 2;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 1.5rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 100px 0 4rem;
        min-height: auto;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-image-container {
        width: 280px;
        height: 280px;
        margin: 0 auto;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
        max-width: 500px;
        margin: 0 auto var(--space-8);
    }
    
    /* Sections */
    .boost-requests-section,
    .services-section,
    .cta-section {
        padding: 4rem 0;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.125rem;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Boost Requests */
    .boost-requests-grid {
        grid-template-columns: 1fr;
    }
    
    .request-meta {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .meta-item:last-child {
        grid-column: span 1;
    }
    
    /* CTA */
    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .cta-text h2 {
        font-size: 2.5rem;
    }
    
    .cta-buttons {
        justify-content: center;
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-left {
        grid-column: span 1;
    }
}

/* Mobile Large (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Hero */
    .hero-section {
        padding: 80px 0 3rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-image-container {
        width: 240px;
        height: 240px;
    }
    
    .floating-card {
        display: none;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .hero-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Sections */
    .boost-requests-section,
    .services-section,
    .cta-section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* CTA */
    .cta-text h2 {
        font-size: 2rem;
    }
    
    .cta-text p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Modal */
    .modal-container {
        width: 95%;
        margin: var(--space-4);
    }
    
    .modal-content {
        padding: var(--space-6);
    }
    
    .role-options {
        grid-template-columns: 1fr;
    }
}

/* Mobile Small (320px - 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Hero */
    .hero-section {
        padding: 70px 0 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
        margin-bottom: 2rem;
    }
    
    .hero-image-container {
        width: 200px;
        height: 200px;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .hero-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem;
        font-size: 0.875rem;
    }
    
    /* Sections */
    .boost-requests-section,
    .services-section,
    .cta-section {
        padding: 2rem 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .section-subtitle {
        font-size: 0.875rem;
    }
    
    /* Boost Requests */
    .boost-request-card {
        padding: 1.25rem;
    }
    
    .rank-progression {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .progression-arrow {
        transform: rotate(90deg);
    }
    
    .request-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem;
    }
    
    /* Services */
    .service-card {
        padding: 1.25rem;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .service-card h3 {
        font-size: 1.125rem;
    }
    
    .service-card p {
        font-size: 0.875rem;
    }
    
    /* CTA */
    .cta-text h2 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .cta-text p {
        font-size: 0.875rem;
    }
    
    .cta-btn {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    /* Footer */
    .main-footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Modal */
    .modal-content {
        padding: var(--space-4);
    }
    
    .modal-title {
        font-size: var(--text-xl);
    }
    
    .modal-subtitle {
        font-size: var(--text-sm);
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .input-group input {
        padding: 0.875rem;
    }
    
    .submit-btn {
        padding: 0.875rem;
        font-size: 0.875rem;
    }
    
    .social-btn {
        padding: 0.875rem;
    }
    
    .mfa-buttons {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start;
    }
}

/* Extra Small Mobile (280px - 319px) */
@media (max-width: 319px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .hero-image-container {
        width: 160px;
        height: 160px;
    }
    
    .boost-request-card,
    .service-card {
        padding: 1rem;
    }
    
    .service-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .main-footer {
        padding: 1.5rem 0 1rem;
    }
    
    .modal-content {
        padding: var(--space-3);
    }
}

/* Landscape Orientation on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 1rem 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr 300px;
        gap: 2rem;
        text-align: left;
    }
    
    .hero-image-container {
        width: 250px;
        height: 250px;
    }
    
    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    
    .boost-requests-section,
    .services-section,
    .cta-section {
        padding: 2rem 0;
    }
    
    .modal-container {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .hero-image,
    .logo-image,
    .footer-logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .main-header,
    .floating-elements,
    .particle-overlay,
    .snow-container,
    .modal-overlay,
    .social-links {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .hero-title,
    .section-title {
        color: black !important;
        background: none !important;
        -webkit-text-fill-color: black !important;
    }
    
    .boost-requests-section,
    .services-section,
    .main-footer {
        background: white !important;
        color: black !important;
    }
    
    .boost-request-card,
    .service-card {
        border: 1px solid black !important;
        background: white !important;
        color: black !important;
        break-inside: avoid;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-image-container,
    .floating-card,
    .logo-fallback {
        animation: none !important;
    }
    
    .animate-on-scroll {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .main-header {
        border-bottom: 3px solid;
    }
    
    .boost-request-card,
    .service-card,
    .modal-container {
        border: 2px solid;
    }
    
    .action-btn,
    .hero-btn,
    .cta-btn,
    .submit-btn {
        border: 1px solid transparent;
    }
    
    .action-btn:focus,
    .hero-btn:focus,
    .cta-btn:focus,
    .submit-btn:focus {
        border-color: var(--primary-blue);
    }
}

/* Dark Mode Preference */
@media (prefers-color-scheme: dark) {
    .main-header.scrolled {
        background: rgba(15, 23, 42, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .main-header.scrolled .main-nav {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .main-header.scrolled .nav-link,
    .main-header.scrolled .user-name,
    .main-header.scrolled .language-selector {
        color: var(--dark-text);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .boost-request-card:hover,
    .service-card:hover {
        transform: none;
    }
    
    .boost-request-card:active,
    .service-card:active {
        transform: scale(0.98);
    }
    
    .nav-link,
    .dropdown-item,
    .header-btn,
    .action-btn,
    .hero-btn,
    .cta-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .social-link,
    .mobile-menu-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Accessibility Improvements */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-blue);
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 6px;
}

/* Focus Indicators */
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.header-btn:focus-visible,
.action-btn:focus-visible,
.hero-btn:focus-visible,
.cta-btn:focus-visible,
.social-link:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* 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;
}

/* Browser Support Fallbacks */
@supports not (backdrop-filter: blur(10px)) {
    .main-header {
        background: rgba(15, 23, 42, 0.95);
    }
    
    .main-header.scrolled {
        background: rgba(255, 255, 255, 0.95);
    }
    
    .boost-request-card,
    .service-card,
    .modal-container {
        background: rgba(30, 41, 59, 0.95);
    }
    
    .main-nav,
    .language-selector,
    .header-btn.secondary {
        background: rgba(255, 255, 255, 0.15);
    }
}

@supports not (grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))) {
    .services-grid,
    .boost-requests-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    
    .services-grid > *,
    .boost-requests-grid > * {
        flex: 1 1 300px;
    }
}

@supports not (display: grid) {
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hero-stats {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2rem;
    }
    
    .stat-item {
        flex: 1 1 150px;
        max-width: 200px;
    }
    
    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    .cta-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Internet Explorer 11 Support */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .hero-content {
        display: -ms-flexbox;
        -ms-flex-direction: column;
        -ms-flex-align: center;
    }
    
    .hero-buttons,
    .cta-buttons {
        display: -ms-flexbox;
        -ms-flex-direction: column;
        -ms-flex-align: stretch;
    }
    
    .services-grid,
    .boost-requests-grid {
        display: -ms-flexbox;
        -ms-flex-wrap: wrap;
    }
    
    .service-card,
    .boost-request-card {
        -ms-flex: 1 1 300px;
        max-width: calc(50% - 1rem);
    }
}

/* Safari Specific Fixes */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        .hero-image,
        .logo-image {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .floating-card {
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
        
        .modal-overlay {
            -webkit-backdrop-filter: blur(8px);
        }
    }
}

/* Firefox Specific Fixes */
@-moz-document url-prefix() {
    .gradient-text {
        background: -moz-linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        -moz-background-clip: text;
        -moz-text-fill-color: transparent;
    }
    
    .section-title,
    .hero-title,
    .footer-logo-text {
        background: -moz-linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        -moz-background-clip: text;
        -moz-text-fill-color: transparent;
    }
}

/* Container Queries (Future-proofing) */
@container (max-width: 600px) {
    .boost-request-card {
        padding: 1rem;
    }
    
    .request-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .action-buttons {
        width: 100%;
        flex-direction: column;
    }
}

@container (max-width: 400px) {
    .service-card {
        padding: 1rem;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .hero-btn,
    .cta-btn {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Dark mode media query for better dark theme support */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: rgba(30, 41, 59, 0.8);
        --card-border: rgba(255, 255, 255, 0.1);
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
    }
    
    .boost-request-card,
    .service-card {
        background: var(--card-bg);
        border-color: var(--card-border);
        color: var(--text-primary);
    }
}

/* Reduced data usage for slow connections */
@media (prefers-reduced-data: reduce) {
    .hero-image,
    .floating-elements,
    .particle-overlay,
    .snow-container {
        display: none;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-link:hover,
    .action-btn:hover,
    .hero-btn:hover {
        transform: none;
    }
}

/* Forced colors mode (Windows High Contrast) */
@media (forced-colors: active) {
    .boost-request-card,
    .service-card,
    .modal-container {
        border: 2px solid ButtonText;
        background: ButtonFace;
        color: ButtonText;
    }
    
    .hero-btn,
    .cta-btn,
    .action-btn,
    .submit-btn {
        border: 2px solid ButtonText;
        background: ButtonFace;
        color: ButtonText;
    }
    
    .hero-btn:hover,
    .cta-btn:hover,
    .action-btn:hover,
    .submit-btn:hover {
        background: Highlight;
        color: HighlightText;
    }
    
    .section-title,
    .hero-title {
        color: WindowText;
        background: none;
        -webkit-text-fill-color: WindowText;
    }
}

/* Very small screens - smartwatch compatibility */
@media (max-width: 200px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .hero-title {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .hero-image-container {
        width: 120px;
        height: 120px;
    }
    
    .boost-request-card,
    .service-card {
        padding: 0.75rem;
    }
    
    .action-btn,
    .hero-btn,
    .cta-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
}

/* Ultra-wide screens */
@media (min-width: 2000px) {
    .container {
        max-width: 1800px;
    }
    
    .hero-content {
        gap: 6rem;
    }
    
    .hero-title {
        font-size: 5rem;
    }
    
    .section-title {
        font-size: 4rem;
    }
    
    .boost-requests-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Foldable devices */
@media (max-width: 653px) and (min-width: 281px) and (orientation: portrait) {
    .hero-content {
        padding: 0 1rem;
    }
    
    .hero-image-container {
        width: min(250px, 80vw);
        height: min(250px, 80vw);
    }
    
    .modal-container {
        width: 95%;
        max-width: 400px;
    }
}

/* Gaming console browsers */
@media (hover: none) and (pointer: none) {
    .boost-request-card,
    .service-card {
        padding: 2rem;
        border: 3px solid var(--primary-blue);
    }
    
    .action-btn,
    .hero-btn,
    .cta-btn {
        padding: 1.5rem;
        font-size: 1.25rem;
        border: 2px solid var(--primary-blue);
    }
    
    .nav-link {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* Screen readers and other assistive technologies */
@media (prefers-reduced-motion: reduce) and (prefers-contrast: high) {
    .boost-request-card,
    .service-card {
        border-width: 3px;
        border-style: solid;
    }
    
    .action-btn,
    .hero-btn,
    .cta-btn {
        border-width: 2px;
        border-style: solid;
    }
    
    .floating-elements,
    .particle-overlay,
    .snow-container {
        display: none;
    }
}

/* Minimum viable layout for emergency/fallback */
@media (max-width: 240px) {
    * {
        font-size: 12px !important;
    }
    
    .container {
        padding: 0 0.25rem;
    }
    
    .hero-section,
    .boost-requests-section,
    .services-section,
    .cta-section {
        padding: 1rem 0;
    }
    
    .boost-request-card,
    .service-card {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-visual,
    .floating-elements {
        display: none;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}