/* Comprehensive Responsive Design for GoldRate.info */

/* Enhanced Mobile Responsive Design */
@media (max-width: 480px) {
    /* Extra small devices */
    .container { 
        padding-left: 0.75rem; 
        padding-right: 0.75rem; 
    }
    
    /* Navigation improvements */
    nav .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .metal-tab { 
        font-size: 0.75rem; 
        padding: 0.5rem 0.25rem; 
    }
    
    .price-card { 
        padding: 1rem !important; 
        min-height: auto; 
    }
    
    .price-card .text-2xl { 
        font-size: 1.5rem !important; 
    }
    
    .price-card .text-3xl { 
        font-size: 1.75rem !important; 
    }
    
    .rates-table { 
        font-size: 0.625rem; 
    }
    
    #metalTitle { 
        font-size: 1.25rem !important; 
    }
    
    #metalSubtitle { 
        font-size: 0.75rem !important; 
    }
    
    .unit-btn { 
        font-size: 0.625rem !important; 
        padding: 0.5rem 0.75rem !important; 
    }
    
    .city-select { 
        font-size: 0.75rem !important; 
    }
    
    /* Form improvements */
    input, select, textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
    
    /* Touch targets */
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    /* Small devices */
    .metal-tab { 
        font-size: 0.875rem; 
        padding: 0.75rem 0.5rem; 
    }
    
    .price-card { 
        min-height: auto; 
    }
    
    .rates-table { 
        font-size: 0.75rem; 
    }
    
    #metalTitle { 
        font-size: 1.5rem !important; 
    }
    
    #metalSubtitle { 
        font-size: 0.875rem !important; 
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    /* Medium devices */
    .price-card { 
        min-height: 180px; 
    }
    
    #metalTitle { 
        font-size: 1.75rem !important; 
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Large devices */
    .price-card { 
        min-height: 200px; 
    }
}

@media (min-width: 1025px) {
    /* Extra large devices */
    .price-card { 
        min-height: 220px; 
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .metal-tab { 
        padding: 0.75rem; 
    }
    
    .unit-btn { 
        padding: 0.75rem 1rem; 
    }
    
    button, a { 
        min-height: 44px; 
        min-width: 44px; 
    }
    
    /* Increase touch targets */
    .price-card {
        margin: 0.25rem;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .price-card { 
        padding: 1rem !important; 
    }
    
    .metal-tab { 
        padding: 0.5rem 0.25rem; 
    }
    
    /* Reduce vertical spacing in landscape */
    main {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card-shadow { 
        box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05); 
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bg-gray-50 {
        background-color: #1f2937;
    }
    
    .text-gray-900 {
        color: #f9fafb;
    }
    
    .text-gray-700 {
        color: #d1d5db;
    }
    
    .text-gray-600 {
        color: #9ca3af;
    }
    
    .bg-white {
        background-color: #374151;
    }
    
    .border-gray-200 {
        border-color: #4b5563;
    }
}

/* Print styles */
@media print {
    .nav, .mobile-menu, button {
        display: none !important;
    }
    
    .price-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

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

/* Small height screens (like foldable phones) */
@media (max-height: 600px) {
    .nav {
        position: relative;
    }
    
    main {
        padding-top: 1rem;
    }
    
    .price-card {
        padding: 0.75rem !important;
    }
}
