/**
 * AMMOcoin Responsive CSS
 * Version: 1.1.0 Emergency Release
 *
 * Mobile-first responsive design for AMMOcoin static website
 * Optimized for all device sizes and orientations
 */

/* Base Mobile-First Styles (320px and up) */
@media (min-width: 320px) {
    .container {
        padding: 0 10px;
    }

    /* Emergency Banner Mobile */
    .emergency-banner {
        padding: 0.5rem 0;
    }

    .emergency-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .emergency-text h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .emergency-text p {
        font-size: 0.9rem;
    }

    .emergency-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    /* Navigation Mobile */
    .main-navigation {
        padding: 0.75rem 0;
    }

    .nav-brand .brand-name {
        font-size: 1.5rem;
    }

    /* Hero Section Mobile */
    .hero-section {
        padding: 2rem 0;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
        border-radius: 8px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    /* Features Grid Mobile */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
        text-align: center;
    }

    .feature-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    /* Download Cards Mobile */
    .download-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .download-card {
        padding: 1.5rem;
        text-align: center;
    }

    .download-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .download-button {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }

    /* Footer Mobile */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-brand {
        text-align: center;
    }

    .footer-stats {
        justify-content: center;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .legal-links {
        justify-content: center;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    /* Typography adjustments */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }

    .section-header h2 {
        font-size: 2rem;
    }

    /* Button adjustments */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 120px;
    }

    /* Hero section adjustments */
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Navigation adjustments */
    .nav-brand .brand-name {
        font-size: 1.3rem;
    }

    .version-badge {
        font-size: 0.6rem;
        padding: 1px 6px;
    }

    /* Emergency banner adjustments */
    .emergency-text h2 {
        font-size: 1.1rem;
    }

    .emergency-text p {
        font-size: 0.85rem;
    }

    .emergency-dismiss {
        top: 5px;
        right: 5px;
        width: 25px;
        height: 25px;
        font-size: 1rem;
    }

    /* Card adjustments */
    .card {
        padding: 1.25rem;
    }

    .feature-card,
    .guide-card,
    .download-card {
        padding: 1.25rem;
    }

    /* Form adjustments */
    input, textarea, select {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Tablet Portrait (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    /* Hero adjustments */
    .hero-content {
        max-width: 600px;
        margin: 0 auto;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-width: 400px;
        margin: 0 auto;
    }

    /* Features grid */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Download grid */
    .download-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Guides grid */
    .guides-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
        text-align: center;
    }
}

/* Tablet Landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }

    /* Navigation */
    .nav-list {
        gap: 1.5rem;
    }

    /* Hero */
    .hero-content {
        max-width: 800px;
        margin: 0 auto;
    }

    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    /* Features grid */
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    /* Download grid */
    .download-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* Guides grid */
    .guides-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* Desktop (1025px - 1200px) */
@media (min-width: 1025px) and (max-width: 1200px) {
    .container {
        max-width: 1000px;
        padding: 0 40px;
    }

    /* All grids at full desktop layout */
    .features-grid,
    .guides-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

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

/* Large Desktop (1201px and up) */
@media (min-width: 1201px) {
    .container {
        max-width: 1200px;
        padding: 0 20px;
    }

    /* Enhanced spacing for large screens */
    section {
        padding: 5rem 0;
    }

    .section-header {
        margin-bottom: 4rem;
    }

    /* Hero enhancements */
    .hero-section {
        padding: 6rem 0;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    /* Card enhancements */
    .card {
        padding: 2.5rem;
    }

    .feature-card,
    .guide-card,
    .download-card {
        padding: 2.5rem;
    }
}

/* Landscape Mobile Specific */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
    }

    .emergency-banner {
        padding: 0.25rem 0;
    }

    .emergency-text h2 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .emergency-text p {
        font-size: 0.8rem;
    }

    section {
        padding: 1.5rem 0;
    }

    .main-navigation {
        padding: 0.5rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .hero-description {
        display: none; /* Hide on small landscape */
    }

    .hero-buttons {
        margin-bottom: 1rem;
    }
}

/* High DPI / Retina Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders and shadows for high DPI displays */
    .card {
        border-width: 0.5px;
    }

    .btn {
        border-width: 1.5px;
    }

    /* Adjust font rendering for retina */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 24px;
    }

    .nav-link {
        padding: 12px 0;
    }

    .mobile-menu-toggle {
        padding: 12px;
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    /* Ensure emergency banner dismiss button is touch-friendly */
    .emergency-dismiss {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
}

/* Dark Mode Adjustments for OLED Displays */
@media (prefers-color-scheme: dark) {
    /* Pure black for OLED power savings */
    body {
        background-color: #000000;
    }

    .card {
        background: linear-gradient(135deg, #111111 0%, #000000 100%);
    }

    .site-header {
        background: rgba(0, 0, 0, 0.98);
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .card:hover {
        transform: none;
    }

    /* Disable emergency pulse animation for reduced motion */
    .btn-emergency {
        animation: none;
    }

    .nav-link.emergency {
        animation: none;
    }
}

/* Print Styles for Mobile */
@media print {
    /* Optimize for mobile printing */
    .container {
        padding: 0;
        max-width: none;
    }

    .hero-section,
    .section {
        padding: 1rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }

    /* Hide interactive elements */
    .btn,
    .emergency-banner,
    .mobile-menu-toggle,
    .back-to-top {
        display: none !important;
    }

    /* Optimize grid layouts for print */
    .features-grid,
    .guides-grid,
    .download-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        border: 1px solid #333;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Accessibility Enhancements */
@media (prefers-contrast: high) {
    /* Higher contrast for accessibility */
    .card {
        border: 2px solid #ffffff;
        background: #000000;
    }

    .btn {
        border-width: 3px;
    }

    .nav-link {
        color: #ffffff;
    }

    .nav-link:hover,
    .nav-link.active {
        color: #00ff00; /* Higher contrast green */
    }
}

/* Focus improvements for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
    *:focus {
        outline: 3px solid #32cd32;
        outline-offset: 3px;
        transition: outline 0.2s ease;
    }
}

/* Very Small Screens (Galaxy Fold, etc.) */
@media (max-width: 280px) {
    .container {
        padding: 0 10px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .nav-brand .brand-name {
        font-size: 1.2rem;
    }

    .version-badge {
        display: none; /* Hide on very small screens */
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: 100px;
    }

    .emergency-text h2 {
        font-size: 1rem;
    }

    .emergency-text p {
        font-size: 0.8rem;
    }
}

/* Ultra-wide Screens (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }

    .hero-section {
        padding: 8rem 0;
    }

    section {
        padding: 6rem 0;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .section-header h2 {
        font-size: 3rem;
    }
}