* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #edf1f5;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 4vw;
    background: rgba(12, 28, 45, 0.94);
    color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.brand {
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
}

.site-nav nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.site-nav nav a {
    color: white;
    text-decoration: none;
    padding: 9px 14px;
    border-radius: 8px;
}

.site-nav nav a.active,
.site-nav nav a:hover {
    background: rgba(255, 255, 255, 0.14);
}

.hero {
    min-height: 315px;
    background:
        linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
        url("/image/v21.jpg");
    background-size: cover;
    background-position: center;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.hero h1 {
    font-size: 52px;
    line-height: 1.05;
    margin: 0 0 18px;
}

.hero p {
    font-size: 26px;
    margin: 0;
}

.floor-buttons,
.layout-button-container {
    text-align: center;
    margin: 32px 0;
}

.floor-buttons button,
.layout-btn {
    border: 0;
    background: #1565c0;
    color: white;
    padding: 13px 30px;
    margin: 6px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.floor-buttons button.active-floor,
.floor-buttons button:hover,
.layout-btn:hover {
    background: #0d47a1;
}

.legend {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
    margin: 24px 0;
}

.legend div {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.available-box,
.booked-box,
.reserved-box {
    width: 22px;
    height: 22px;
    display: inline-block;
    border-radius: 5px;
}

.available-box,
.available {
    background: #28a745;
}

.booked-box,
.booked {
    background: #dc3545;
}

.reserved-box,
.reserved {
    background: #ffc107;
}

.parking-container {
    width: 96%;
    margin: 0 auto 48px;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}

.row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 34px;
}

.side-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 34px;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.middle {
    flex: 1;
}

.parking-space {
    width: 106px;
    height: 54px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease;
}

.parking-space.reserved {
    color: #111827;
}

.parking-space:hover {
    transform: scale(1.04);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow: auto;
    background: rgba(0, 0, 0, 0.9);
    padding: 72px 24px;
}

.modal-content {
    display: block;
    width: min(1200px, 96vw);
    margin: auto;
    border-radius: 8px;
}

.close {
    position: fixed;
    top: 18px;
    right: 28px;
    border: 0;
    background: transparent;
    color: white;
    font-size: 42px;
    cursor: pointer;
}

.form-page,
.admin-page {
    min-height: calc(100vh - 58px);
    background:
        linear-gradient(rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.46)),
        url("/image/admin-bg.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 46px 20px;
}

.form-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.login-card,
.booking-card {
    width: min(650px, 100%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 42px;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

.login-card {
    width: min(450px, 100%);
    text-align: center;
}

.login-card h1,
.booking-card h1 {
    color: white;
    text-align: center;
    font-size: 38px;
    line-height: 1.1;
    margin: 0 0 26px;
}

.login-card h2,
.booking-card h3 {
    color: white;
}

.booking-card h3 {
    margin: 24px 0 12px;
    font-size: 22px;
}

.login-card input,
.booking-card input,
.booking-card select {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    border: 0;
    border-radius: 8px;
    outline: 0;
}

.booking-card button,
.login-card button {
    width: 100%;
    padding: 16px;
    border: 0;
    border-radius: 8px;
    background: #198754;
    color: white;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}

.booking-card button:hover,
.login-card button:hover {
    background: #157347;
}

.parking-info,
.alert-box {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 22px;
    text-align: center;
    font-size: 20px;
}

.parking-info {
    background: #0d6efd;
    color: white;
}

.alert-box.error {
    background: #dc3545;
    color: white;
}

.back-btn {
    display: block;
    text-align: center;
    margin-top: 18px;
    padding: 16px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 800;
}

.back-btn:hover {
    background: #565e64;
}

.terms {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    margin: 20px 0;
}

.terms input {
    width: auto;
    margin: 0;
}

.success-card p,
.application-detail p {
    color: white;
    font-size: 19px;
    margin: 8px 0 18px;
}

.container {
    width: min(1500px, 96%);
    margin: auto;
}

.top-bar {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 34px;
}

.top-bar h1 {
    color: white;
    font-size: 38px;
    text-align: center;
    margin: 0;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.logout-btn {
    position: absolute;
    right: 0;
    background: #dc3545;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
}

.stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 18px;
    margin-bottom: 34px;
}

.card {
    display: block;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.16);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    padding: 28px 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.card h2 {
    font-size: 46px;
    margin: 0 0 8px;
}

.card p {
    margin: 0;
    font-size: 18px;
}

.available-card {
    border-left: 8px solid #28a745;
}

.booked-card {
    border-left: 8px solid #dc3545;
}

.reserved-card {
    border-left: 8px solid #ffc107;
}

.table-container {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow-x: auto;
}

.table-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.table-heading h2 {
    margin: 0;
}

.top-actions {
    display: flex;
    gap: 12px;
}

.booking-table {
    width: 100%;
    border-collapse: collapse;
}

.booking-table th {
    background: #0d6efd;
    color: white;
    padding: 15px;
    white-space: nowrap;
}

.booking-table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    vertical-align: middle;
}

.available-status,
.booked-status,
.reserved-status {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.available-status {
    background: #28a745;
    color: white;
}

.booked-status {
    background: #dc3545;
    color: white;
}

.reserved-status {
    background: #ffc107;
    color: #111827;
}

.application-btn,
.export-btn,
.approve-btn,
.reject-btn {
    display: inline-block;
    border: 0;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 700;
    margin: 3px;
    cursor: pointer;
    white-space: nowrap;
}

.application-btn {
    background: #0d6efd;
}

.export-btn {
    background: #198754;
}

.approve-btn {
    background: #28a745;
}

.reject-btn {
    background: #dc3545;
}

#blazor-error-ui {
    display: none;
}

@media (max-width: 1000px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .side-row {
        flex-direction: column;
    }

    .left-column,
    .right-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .top-bar {
        flex-direction: column;
        gap: 16px;
    }

    .logout-btn {
        position: static;
    }
}

@media (max-width: 700px) {
    .site-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 20px;
    }

    .parking-container,
    .booking-card,
    .login-card,
    .table-container {
        padding: 20px;
    }

    .parking-space {
        width: 92px;
        height: 50px;
        font-size: 12px;
    }

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

    .table-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}
