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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

main {
    flex: 1;
}

.converter-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.city-section,
.time-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* City Search */
.city-search-wrapper {
    position: relative;
}

.city-search-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-family: inherit;
    transition: all 0.2s ease;
}

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

.city-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e8e8e8;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.city-dropdown.hidden {
    display: none;
}

.city-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.city-dropdown-item:hover {
    background: #f8f8f8;
}

.city-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.city-loading {
    color: #aaa;
    font-style: italic;
    cursor: default;
}


.city-selected {
    padding: 12px 16px;
    background: #f8f8f8;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.city-selected.hidden {
    display: none;
}

#source-city-name,
#dest-city-name {
    font-weight: 600;
    color: #333;
}

#source-tz,
#dest-tz {
    font-size: 0.85rem;
    color: #888;
    background: white;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    font-weight: 500;
}

/* Time Section */
.time-controls {
    display: flex;
    gap: 10px;
}

.time-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-family: inherit;
    transition: all 0.2s ease;
}

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

.btn-icon {
    padding: 14px 16px;
    background: #f0f0f0;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-icon:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

.btn-icon:active {
    transform: scale(0.98);
}

/* Results */
.results {
    background: linear-gradient(135deg, #f5f7ff 0%, #f0ebff 100%);
    border-radius: 12px;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.results.hidden {
    display: none;
}

.result-item {
    display: flex;
    flex-direction: column;
}

.result-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.result-time {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1.2;
}

.result-date {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
}

.result-diff {
    font-size: 1.3rem;
    font-weight: 700;
    color: #764ba2;
}

footer {
    text-align: center;
    color: white;
    padding: 40px 0;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Scrollbar styling */
.city-dropdown::-webkit-scrollbar {
    width: 6px;
}

.city-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.city-dropdown::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.city-dropdown::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.6rem;
    }

    .converter-card {
        padding: 20px;
        gap: 16px;
    }

    .results {
        grid-template-columns: 1fr;
    }

    .time-controls {
        flex-wrap: wrap;
    }

    .time-input {
        flex: 1 1 100%;
    }

    .btn-icon {
        flex: 1 1 calc(50% - 5px);
    }
}
