/* --- ГЛОБАЛЬНЫЕ НАСТРОЙКИ --- */
:root {
    --accent: #6366f1;       /* Основной фиолетовый  */
    --accent-hover: #4f46e5;
    --text-dark: #1e293b;    /* Темно-серый текст */
    --text-light: #64748b;   /* Светло-серый текст */
    --white-glass: rgba(255, 255, 255, 0.80);
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;
}

/* Самое важное исправление скролла: */
* {
    box-sizing: border-box; /* Учитывать padding в ширине */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Manrope', sans-serif;
    background: var(--bg-gradient-start);
    color: var(--text-dark);
    height: 100vh;       /* Строго высота экрана */
    width: 100vw;        /* Строго ширина экрана */
    overflow: hidden;    /* ЗАПРЕТИТЬ скролл страницы целиком */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- ЯРКИЙ ФОН С АНИМАЦИЕЙ --- */
.gradient-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
}

.orb-1 {
    width: 60vh; height: 60vh;
    background: radial-gradient(circle, #a78bfa, #818cf8);
    top: -10%; left: -10%;
    animation: float 10s ease-in-out infinite alternate;
}

.orb-2 {
    width: 50vh; height: 50vh;
    background: radial-gradient(circle, #f472b6, #fb7185);
    bottom: -10%; right: -10%;
    animation: float 12s ease-in-out infinite alternate-reverse;
}

.orb-3 {
    width: 30vh; height: 30vh;
    background: #38bdf8;
    top: 40%; left: 40%;
    animation: float 15s infinite linear;
    opacity: 0.4;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

/* --- ОСНОВНАЯ ПАНЕЛЬ (СТЕКЛО) --- */
.glass-panel {
    width: 95%;
    max-width: 1400px;
    height: 90vh; /* Высота панели */

    background: var(--white-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);

    display: flex;
    flex-direction: column;
    overflow: hidden; /* Чтобы скругленные углы не резали контент */
}

/* --- ШАПКА --- */
header {
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0; /* Шапка не сжимается */
}

.logo-section { display: flex; align-items: center; gap: 15px; }
.icon-box {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white; border-radius: 14px;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.4rem;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.25);
}
.titles h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.5px; line-height: 1.2; }
.titles span { color: var(--text-light); font-size: 0.85rem; font-weight: 600; }

.status-pill {
    background: white; padding: 8px 20px;
    border-radius: 50px; border: 1px solid rgba(0,0,0,0.05);
    font-weight: 600; color: var(--text-light);
    display: flex; align-items: center; gap: 10px;
}
.dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; display: block; box-shadow: 0 0 8px #22c55e; }
.status-pill strong { color: var(--text-dark); font-size: 1.1rem; }

/* --- ОБЛАСТЬ СЕТКИ --- */
main {
    flex: 1; /* Занимает все оставшееся место */
    overflow-y: auto; /* Скролл только здесь! */
    padding: 30px 40px 60px 40px; /* Отступ снизу побольше */
}

/* Кастомный скроллбар */
main::-webkit-scrollbar { width: 8px; }
main::-webkit-scrollbar-track { background: transparent; }
main::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
main::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.parking-grid {
    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
}


@media (min-width: 1200px) {
    .parking-grid { grid-template-columns: repeat(8, 1fr); }
}

/* --- КАРТОЧКА МЕСТА --- */
.spot {
    background: white;
    border-radius: 20px;
    aspect-ratio: 1/1; /* Квадрат */
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    position: relative;
}

.spot:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Свободно */
.spot .label { font-size: 1.2rem; font-weight: 800; color: #cbd5e1; margin-bottom: 5px; }
.spot i.fa-plus { font-size: 1.6rem; color: #e2e8f0; transition: 0.3s; }
.spot:hover i.fa-plus { color: var(--accent); transform: scale(1.1) rotate(90deg); }

/* Занято (Чужое) */
.spot.occupied {
    background: #fff1f2;
    cursor: not-allowed;
}
.spot.occupied:hover { transform: none; box-shadow: none; }
.spot.occupied i.fa-lock { color: #fda4af; font-size: 2rem; }
.spot.occupied .label { color: #fb7185; }

/* Занято (Моё место) */
.spot.my-spot {
    background: #fff;
    border: 2px solid var(--accent);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
    justify-content: space-between;
    padding: 12px;
}
.spot.my-spot:hover { transform: translateY(-5px); }

.spot.my-spot .plate {
    background: var(--text-dark); color: white;
    padding: 4px 8px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px;
    width: 100%; text-align: center;
}

.spot.my-spot i.fa-car-on {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin: 5px 0;
}

/* Живой таймер внутри карточки */
.live-stats {
    display: flex; flex-direction: column; align-items: center; width: 100%;
}
.live-timer {
    font-size: 0.75rem; font-family: 'Manrope', monospace;
    color: var(--text-light); background: #f1f5f9;
    padding: 2px 6px; border-radius: 4px; margin-bottom: 2px;
}
.live-cost { font-size: 0.9rem; font-weight: 800; color: var(--accent); }


/* --- МОДАЛЬНЫЕ ОКНА --- */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex; justify-content: center; align-items: center;
    opacity: 1; transition: opacity 0.2s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.modal {
    background: white;
    width: 380px; max-width: 90%;
    padding: 35px;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    position: relative;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.hidden { display: none; }

@keyframes popIn {
    from { transform: scale(0.95) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute; top: 20px; right: 20px;
    background: #f1f5f9; border: none; width: 32px; height: 32px;
    border-radius: 50%; color: var(--text-light); cursor: pointer;
    transition: 0.2s; display: flex; justify-content: center; align-items: center;
}
.close-btn:hover { background: #e2e8f0; color: var(--text-dark); }

.modal-header h2 { margin: 0 0 5px 0; font-size: 1.5rem; }
.badge { background: #e0e7ff; color: var(--accent); padding: 4px 10px; border-radius: 6px; font-weight: 800; }

/* Поля ввода */
.input-wrap { position: relative; margin-bottom: 15px; }
.input-wrap i {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; pointer-events: none;
}
.input-wrap input {
    width: 100%; padding: 14px 14px 14px 45px;
    border: 2px solid #f1f5f9; border-radius: 14px;
    font-size: 1rem; font-weight: 600; font-family: inherit;
    box-sizing: border-box; outline: none; transition: 0.2s;
}
.input-wrap input:focus { border-color: var(--accent); background: #fdfdff; }

/* Кнопки */
.cta-btn {
    width: 100%; padding: 16px; margin-top: 10px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: white; border: none; border-radius: 14px;
    font-size: 1.1rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
    transition: 0.2s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.5); }
.cta-btn.secondary { background: var(--text-dark); box-shadow: none; }

/* Элементы чека */
.check-ring {
    width: 60px; height: 60px; background: #dcfce7; color: #16a34a;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; margin: 0 auto 15px auto;
}
.receipt { background: #f8fafc; border-radius: 16px; padding: 20px; margin: 20px 0; }
.r-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.95rem; color: var(--text-light); }
.r-row.total { color: var(--text-dark); font-weight: 800; font-size: 1.2rem; border-top: 2px dashed #e2e8f0; padding-top: 15px; margin-top: 10px; }
.qr-frame { display: flex; justify-content: center; margin-bottom: 20px; padding: 10px; background: white; border-radius: 12px; border: 1px solid #f1f5f9; width: fit-content; margin: 0 auto 20px auto; }

/* --- СТИЛИ ДЛЯ ЭТАЖЕЙ (ВНИЗУ) --- */
.floor-switcher {
    padding: 20px 40px;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    gap: 15px;
    background: rgba(255,255,255,0.4);
}

.floor-btn {
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: white;
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    font-family: 'Manrope', sans-serif;
}

.floor-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
    color: var(--text-dark);
}

.floor-btn.active {
    background: var(--text-dark);
    color: white;
    box-shadow: 0 10px 20px rgba(30, 41, 59, 0.3);
}


main {
    padding-bottom: 20px;
}