:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --accent: #f472b6;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

main {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.primary-btn {
    background: var(--primary);
    color: #0f172a;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.date-display {
    display: flex;
    align-items: center;
}

#date-picker {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    cursor: pointer;
    outline: none;
    color-scheme: dark;
    transition: all 0.2s;
    min-width: 200px;
}

#date-picker:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

#date-picker:hover {
    border-color: var(--text-muted);
}

.cities-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.city-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.city-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border);
}

.city-card.night {
    border-left: 4px solid #6366f1;
    /* Indigo for night */
    background: linear-gradient(90deg, rgba(30, 27, 75, 0.5) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.city-info {
    display: flex;
    flex-direction: column;
}

.city-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.city-offset {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.city-time {
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 1rem;
    font-variant-numeric: tabular-nums;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: color 0.2s;
}

.remove-btn:hover {
    color: #ef4444;
}

.slider-container {
    margin-bottom: 3rem;
    position: relative;
    padding: 0 1rem;
}

input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    margin-top: -10px;
    box-shadow: 0 0 10px var(--primary);
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #334155;
    border-radius: 2px;
}

.slider-tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #0f172a;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1e293b;
    padding: 2rem;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

#city-search {
    width: 100%;
    padding: 1rem;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
}

#city-search:focus {
    border-color: var(--primary);
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.search-item {
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 100%;
    padding: 0.5rem;
}

.text-btn:hover {
    color: var(--text);
}
