:root {
    --bg: #0F1621;
    --text: #EFF2F5;
    --hint: #6B7D8D;
    --button: #3390EC;
    --button-text: #FFFFFF;
    --secondary: #1A2330;
    --border: #253341;
    --accent: #47A4FF;
    --error: #FF4B4B;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    padding: 14px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.header {
    color: var(--hint);
    text-align: center;
    margin: 0 0 25px 0;
    animation: fadeIn 0.3s ease-out forwards;
    opacity: 0;
    font-size: 0.9em;
}

.search-box {
    margin-bottom: 16px;
    animation: fadeIn 0.3s 0.1s ease-out forwards;
    opacity: 0;
}

.search-input {
    width: 100%;
    padding: 14px 48px;
    background: var(--secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text);
    transition: border-color 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7D8D' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center;
}

.search-input:focus {
    border-color: var(--accent);
    outline: none;
}

.cities-list {
    background: var(--secondary);
    border-radius: 12px;
    border: 2px solid var(--border);
    max-height: 60vh;
    overflow-y: auto;
    animation: slideUp 0.3s 0.2s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

.no-results {
    padding: 24px;
    text-align: center;
    color: var(--hint);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.no-results::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%236B7D8D' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 12h8'/%3E%3C/svg%3E");
}

.city-item {
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.city-item:last-child {
    border-bottom: none;
}

.city-item:hover {
    background: rgba(255,255,255,0.03);
}

.selected {
    background: rgba(71, 164, 255, 0.08) !important;
}

.check-icon {
    width: 20px;
    height: 20px;
    margin-left: auto;
    opacity: 0;
    transition: all 0.2s ease;
}

.selected .check-icon {
    opacity: 1;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2347A4FF' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}

.selected-cities {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    background: var(--secondary);
    padding: 16px 20px;
    border-top: 2px solid var(--border);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-width: 600px;
    margin: 0 auto;
}

.visible {
    transform: translateY(0);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--button);
    color: var(--button-text);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    animation: tagAppear 0.2s ease-out;
}

.remove-tag {
    cursor: pointer;
    margin-left: 8px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.remove-tag:hover {
    opacity: 1;
}

.button-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: var(--bg);
    border-top: 2px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
}

.done-btn {
    width: 100%;
    padding: 14px;
    background: var(--button);
    color: var(--button-text);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.7px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.done-btn:disabled {
    background: #2D3847;
    color: #5E6E81;
    cursor: not-allowed;
}

.done-btn:not(:disabled):hover {
    opacity: 0.9;
}

.error-message {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--error);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    animation: shake 0.4s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tagAppear {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    25% { transform: translateX(-50%) translateY(-2px); }
    75% { transform: translateX(-50%) translateY(2px); }
}


.done-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.25);
}

.done-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 6px rgba(51, 144, 236, 0.25);
}

@keyframes shakeDisabled {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-3px); }
}

.shake {
    animation: shakeDisabled 0.4s ease;
}

.error-message.success {
    background: #2ecc71;
    animation: fadeIn 0.3s ease-out;
}