/* CSS Variables & Reset */
:root {
    --primary: #4F46E5;
    /* Indigo 600 */
    --primary-hover: #4338CA;
    /* Indigo 700 */
    --bg-gradient-start: #0f172a;
    /* Slate 900 */
    --bg-gradient-end: #1e293b;
    /* Slate 800 */
    --surface: rgba(30, 41, 59, 0.7);
    /* Glassy Slate */
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --danger: #ef4444;
    --success: #22c55e;
    --font-family: 'Outfit', sans-serif;
    --app-max-width: 480px;
    /* Mobile width */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: var(--app-max-width);
    min-height: 100vh;
    position: relative;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    /* transition: all 0.3s ease; */
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

/* Glassmorphism Card */
.card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    width: 100%;
    animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Inputs & Buttons */
.input-group {
    margin-bottom: 1.5rem;
}

input {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

button.primary-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

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

button.primary-btn:hover {
    background: var(--primary-hover);
}

button.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 1rem;
    text-decoration: underline;
}

/* List Styles */
.shelter-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shelter-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shelter-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.shelter-option.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

/* Counter View */
.counter-container {
    text-align: center;
    padding: 2rem 0;
}

.bed-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.big-number {
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
    margin: 0.5rem 0;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stepper-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.step-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.step-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.step-btn:active {
    transform: scale(0.9);
}

.step-btn.minus {
    color: #fca5a5;
}

.step-btn.plus {
    color: #86efac;
    background: rgba(34, 197, 94, 0.15);
}

.step-btn.plus:hover {
    background: rgba(34, 197, 94, 0.25);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.logout-btn {
    background: none;
    border: 1px solid var(--surface-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Utility */
.hidden {
    display: none !important;
}

.error-msg {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

/* Danger Button */
button.danger-btn {
    width: 75%;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    /* Red with opacity */
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: 2rem auto;
    display: block;
}

button.danger-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions button {
    flex: 1;
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.modal-btn-cancel {
    background: transparent;
    border: 1px solid var(--surface-border) !important;
    color: var(--text-muted);
}

.modal-btn-confirm {
    background: var(--primary);
    color: white;
}

/* Banner Notification */
.banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    /* Start hidden below */
    background: var(--success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    white-space: nowrap;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 16px;
    margin: 0 auto 2rem auto;
    border: 1px solid var(--surface-border);
    width: 75%;
}

.toggle-label-text {
    font-weight: 500;
    font-size: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--success);
}

input:focus+.toggle-slider {
    box-shadow: 0 0 1px var(--success);
}

input:checked+.toggle-slider:before {
    transform: translateX(22px);
}