/* Enhanced styles.css with mobile responsiveness improvements */

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Base font size for responsive typography */
html {
    font-size: 16px;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
}

/* Dynamic Background */
.dynamic-bg {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
}

/* Animation Effects */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Custom Maroon Color */
.bg-maroon-500 {
    background-color: #800000;
}

/* Weather Icons - Responsive sizing */
.weather-icon {
    width: 3.125rem;
    height: 3.125rem;
    max-width: 100%;
}

/* Dynamic Backgrounds */
.sunny { background: linear-gradient(135deg, #ff9a9e, #fad0c4); }
.rainy { background: linear-gradient(135deg, #6dd5ed, #2193b0); }
.cloudy { background: linear-gradient(135deg, #bdc3c7, #2c3e50); }

/* Result Container */
.result-container {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1.25rem;
    border-radius: 0.625rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
    margin-bottom: 1.25rem;
    text-align: center;
    width: 100%;
    max-width: 40rem;
}

/* Result Text */
#result {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.625rem;
}

/* Weather Text */
#weather {
    font-size: 1.25rem;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Weather Icon */
#weather img {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.625rem;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    html {
        font-size: 14px; /* Slightly smaller base font size on mobile */
    }
    
    .w-20 {
        width: 3.75rem; /* Slightly wider sidebar on mobile */
    }
    
    /* Ensure all interactive elements have adequate touch targets */
    button, 
    a, 
    input[type="button"],
    input[type="submit"],
    input[type="text"],
    input[type="number"],
    input[type="time"],
    select, 
    textarea {
        min-height: 2.75rem; /* 44px for touch targets */
        min-width: 2.75rem; /* 44px for touch targets */
        padding: 0.75rem 1rem;
        margin: 0.5rem 0;
    }
    
    /* Adjust icon sizes for better visibility on mobile */
    .text-3xl {
        font-size: 1.5rem;
    }
    
    /* Smaller text under icons */
    .text-sm {
        font-size: 0.7rem;
    }
    
    /* Adjust padding for mobile */
    .p-4 {
        padding: 0.75rem;
    }
    
    /* Adjust city cards for mobile */
    .city-card {
        padding: 0.75rem;
    }
    
    /* Make grid layouts stack on mobile */
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Adjust map height for mobile */
    #map {
        height: 300px !important;
        width: 100% !important;
    }
    
    /* Adjust modal width for mobile */
    #alarmModal > div,
    #timerModal > div,
    #stopwatchDisplay > div,
    #timeComparisonModal > div {
        width: 90% !important;
        padding: 1rem !important;
    }
    
    /* Stack modal buttons on mobile */
    #alarmModal .flex,
    #timerModal .flex,
    #stopwatchDisplay .flex {
        flex-direction: column;
    }
    
    #alarmModal button,
    #timerModal button,
    #stopwatchDisplay button {
        margin: 0.25rem 0;
        width: 100%;
    }
    
    /* Adjust result container for mobile */
    .result-container {
        padding: 1rem;
        width: 90%;
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    html {
        font-size: 15px;
    }
    
    /* Adjust grid for tablets */
    .grid-cols-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    /* Adjust map for tablets */
    #map {
        width: 85% !important;
    }
}

/* Larger Screens */
@media (min-width: 1025px) {
    html {
        font-size: 16px;
    }
    
    /* Enhance hover effects on larger screens */
    button:hover,
    a:hover {
        transform: translateY(-2px);
        transition: transform 0.2s ease;
    }
}

/* Accessibility Improvements */
:focus {
    outline: 0.125rem solid #4299e1;
    outline-offset: 0.125rem;
}

/* Improved button styles for better visibility */
button {
    transition: all 0.2s ease-in-out;
}

button:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
}

/* Improved contrast for better readability */
.text-gray-300 {
    color: #d1d5db;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy Loading Placeholder */
.lazy-load-image {
    background-color: #f0f0f0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Print styles for better printing */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-gray-800, .bg-gray-700 {
        background-color: white !important;
        color: black !important;
        border: 1px solid #ddd;
    }
    
    .text-white, .text-gray-300 {
        color: black !important;
    }
    
    .w-20, .sidebar, button {
        display: none !important;
    }
    
    .flex-1 {
        margin-left: 0 !important;
    }
    
    a {
        text-decoration: underline;
        color: black !important;
    }
    
    #map {
        height: 300px !important;
    }
}

/* Enhanced Card Styles */
.city-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.city-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Improved Form Elements */
input, select, textarea {
    border: 2px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

/* Enhanced Modal Styles */
#alarmModal, #timerModal, #stopwatchDisplay, #timeComparisonModal {
    backdrop-filter: blur(5px);
}

/* Improved Footer */
footer {
    margin-top: 3rem;
    padding: 2rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a {
    margin: 0 0.5rem;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .result-container {
        background-color: rgba(30, 30, 30, 0.9);
        color: #f0f0f0;
    }
    
    #result {
        color: #f0f0f0;
    }
    
    #weather {
        color: #d0d0d0;
    }
}
