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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.utility-links {
    margin-top: 24px;
}

.utility-links a {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(99, 179, 237, 0.95), rgba(129, 140, 248, 0.95));
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 18px 30px rgba(59, 130, 246, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.utility-links a:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 22px 40px rgba(99, 102, 241, 0.35);
}

/* Local Time Section */
.local-time-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.local-time-section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.time-display {
    text-align: center;
    margin-bottom: 30px;
}

.time-display .time {
    font-size: 3rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 10px;
}

.time-display .date {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 5px;
}

.time-display .timezone {
    font-size: 1rem;
    color: #a0aec0;
}

/* Time Slider */
.time-slider-container {
    background: #f7fafc;
    padding: 24px 20px 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    position: relative;
}

.time-offset-display {
    text-align: right;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 16px;
    font-size: 1rem;
}

.time-slider-container label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #4a5568;
}

.slider-tooltip {
    position: absolute;
    background: #2d3748;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(6px);
    pointer-events: none;
}

.slider-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#timeSlider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
    margin-bottom: 10px;
    -webkit-appearance: none;
}

#timeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#timeSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.reset-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: #5a6fd8;
}

/* Cities Section */
.cities-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.cities-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.cities-header h2 {
    color: #4a5568;
    font-size: 1.5rem;
}

.add-city-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.add-city-btn:hover {
    background: #38a169;
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.city-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.city-card h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.city-card .time {
    font-size: 2rem;
    font-weight: bold;
    color: #4a5568;
    margin-bottom: 5px;
}

.city-card .date {
    color: #718096;
    margin-bottom: 5px;
}

.city-card .timezone {
    color: #a0aec0;
    font-size: 0.9rem;
}

.remove-city {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f56565;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.city-card:hover .remove-city {
    opacity: 1;
}

.remove-city:hover {
    background: #e53e3e;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal h3 {
    margin-bottom: 20px;
    color: #4a5568;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group .field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #718096;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.form-buttons button[type="submit"] {
    background: #48bb78;
    color: white;
}

.form-buttons button[type="submit"]:hover {
    background: #38a169;
}

.form-buttons button[type="button"] {
    background: #e2e8f0;
    color: #4a5568;
}

.form-buttons button[type="button"]:hover {
    background: #cbd5e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .time-display .time {
        font-size: 2.5rem;
    }
    
    .cities-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .cities-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}