* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Bricolage Grotesque', sans-serif;
    min-height: 100vh;
    transition: background-color 0.5s ease;
}

.app-container {
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.8s ease;
}

.app-content {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.app-header {
    text-align: center;
    padding: 20px 0;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1F2937;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.5);
    letter-spacing: -0.02em;
}

.app-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #4B5563;
    margin-top: 8px;
    font-weight: 300;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.city-input {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.125rem;
    font-family: 'Bricolage Grotesque', sans-serif;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 16px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    outline: none;
    transition: all 0.3s ease;
}

.city-input:focus {
    border-color: #6366F1;
    box-shadow: 0 4px 30px rgba(99,102,241,0.2);
}

.city-input::placeholder {
    color: #9CA3AF;
}

.generate-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #A855F7 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
    transition: all 0.3s ease;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99,102,241,0.5);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.presets-section {
    overflow: hidden;
    margin: 0 -20px;
    padding: 0 20px;
}

.presets-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.presets-scroll::-webkit-scrollbar {
    display: none;
}

.preset-btn {
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: #374151;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.preset-btn:hover:not(:disabled) {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error-message {
    padding: 16px 20px;
    background: #FEE2E2;
    border: 1px solid #FECACA;
    border-radius: 12px;
    color: #DC2626;
    font-size: 0.9rem;
    text-align: center;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 60px 20px;
}

.spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(99,102,241,0.2);
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #4B5563;
    animation: pulse 2s ease-in-out infinite;
}

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

.weather-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-image-container {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 30px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 70%, transparent 100%);
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.city-name {
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 2px 3px 8px rgba(0,0,0,0.4);
    letter-spacing: -0.02em;
}

.overlay-icon {
    width: 64px;
    height: 64px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.card-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: capitalize;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.card-temp {
    font-size: 1.75rem;
    font-weight: 600;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.3);
}

.download-btn {
    width: 100%;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6366F1;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: #F5F3FF;
    color: #4F46E5;
}

.history-section {
    padding-top: 10px;
}

.history-title {
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    color: #4B5563;
    margin-bottom: 12px;
    font-weight: 500;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.history-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.history-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px;
    font-size: 0.625rem;
    font-family: 'JetBrains Mono', monospace;
    color: white;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    text-align: center;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.app-footer {
    text-align: center;
    padding: 20px 0 10px;
}

.app-footer a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #6B7280;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.app-footer a:hover {
    opacity: 1;
}

.weather-icon svg {
    width: 100%;
    height: 100%;
}

@media (max-width: 480px) {
    .app-container {
        padding: 16px;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .city-name {
        font-size: 2rem;
    }
    
    .city-input {
        padding: 14px 18px;
        font-size: 1rem;
    }
    
    .generate-btn {
        padding: 14px 20px;
    }
}

@media (prefers-color-scheme: dark) {
    .city-input {
        background: rgba(31,41,55,0.9);
        color: #F9FAFB;
        border-color: rgba(75,85,99,0.5);
    }
    
    .city-input::placeholder {
        color: #6B7280;
    }
    
    .preset-btn {
        background: rgba(31,41,55,0.8);
        color: #E5E7EB;
        border-color: rgba(75,85,99,0.5);
    }
    
    .preset-btn:hover:not(:disabled) {
        background: #374151;
    }
    
    .weather-card {
        background: #1F2937;
    }
    
    .download-btn {
        color: #A5B4FC;
    }
    
    .download-btn:hover {
        background: rgba(99,102,241,0.2);
    }
    
    .app-title {
        color: #F9FAFB;
        text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    }
    
    .app-subtitle,
    .history-title {
        color: #9CA3AF;
    }
    
    .app-footer a {
        color: #9CA3AF;
    }
}