/* =========================================================
   SMART PARKING MANAGEMENT
   Professional Dashboard UI
   ========================================================= */


/* ---------- Reset ---------- */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #f5f7fb;
    color: #172033;
    min-height: 100vh;
}


/* ---------- Navbar ---------- */

.navbar {
    height: 72px;
    background: #ffffff;
    border-bottom: 1px solid #e8ebf2;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 7%;

    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #172033;
}

.logo span {
    color: #2563eb;
}

.navbar nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navbar nav a {
    text-decoration: none;
    color: #697386;
    font-size: 14px;
    font-weight: 600;

    padding: 25px 0;

    position: relative;

    transition: color 0.2s ease;
}

.navbar nav a:hover {
    color: #2563eb;
}

.navbar nav a.active {
    color: #2563eb;
}

.navbar nav a.active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 3px;

    background: #2563eb;
    border-radius: 3px 3px 0 0;
}


/* ---------- Main ---------- */

main {
    width: 86%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 0 70px;
}


/* ---------- Hero ---------- */

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 35px;
}

.hero h1 {
    font-size: 34px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -1px;

    margin-bottom: 9px;
}

.hero p {
    color: #7a8496;
    font-size: 15px;
}


/* ---------- Buttons ---------- */

.add-btn {
    border: none;
    background: #2563eb;
    color: white;

    padding: 13px 20px;

    border-radius: 9px;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.18);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.add-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(37, 99, 235, 0.25);
}

.add-btn:active {
    transform: translateY(0);
}


/* ---------- Statistics ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;

    margin-bottom: 48px;
}

.stat-card {
    background: #ffffff;

    border: 1px solid #e9edf4;

    border-radius: 14px;

    padding: 24px;

    display: flex;
    align-items: center;
    gap: 18px;

    box-shadow: 0 3px 12px rgba(23, 32, 51, 0.035);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);

    box-shadow: 0 8px 24px rgba(23, 32, 51, 0.07);
}

.stat-icon {
    width: 48px;
    height: 48px;

    border-radius: 11px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eff6ff;
    color: #2563eb;

    font-size: 17px;
    font-weight: 800;
}

.stat-icon.available {
    background: #ecfdf3;
    color: #16a34a;
}

.stat-icon.occupied {
    background: #fff7ed;
    color: #ea580c;
}

.stat-card p {
    color: #7a8496;

    font-size: 13px;
    font-weight: 600;

    margin-bottom: 5px;
}

.stat-card h2 {
    font-size: 27px;
    font-weight: 800;
    color: #172033;
}


/* ---------- Parking Section ---------- */

.parking-section {
    background: #ffffff;

    border: 1px solid #e9edf4;

    border-radius: 16px;

    padding: 30px;

    box-shadow: 0 3px 12px rgba(23, 32, 51, 0.035);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 26px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 800;

    margin-bottom: 5px;
}

.section-header p {
    font-size: 13px;
    color: #7a8496;
}

.refresh-btn {
    background: #ffffff;

    border: 1px solid #dce1e9;

    color: #4b5565;

    padding: 9px 15px;

    border-radius: 8px;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s ease;
}

.refresh-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #f8fbff;
}


/* ---------- Slot Grid ---------- */

.slot-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(220px, 1fr));

    gap: 18px;
}


/* ---------- Slot Card ---------- */

.slot-card {
    border: 1px solid #e7ebf1;

    border-radius: 13px;

    padding: 20px;

    background: #ffffff;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.slot-card:hover {
    transform: translateY(-2px);

    border-color: #d6dce7;

    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.07);
}

.slot-top {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 18px;
}

.slot-number {
    font-size: 20px;
    font-weight: 800;
    color: #172033;
}

.slot-status {
    padding: 5px 9px;

    border-radius: 20px;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.4px;
}

.slot-status.available {
    background: #ecfdf3;
    color: #15803d;
}

.slot-status.occupied {
    background: #fff7ed;
    color: #c2410c;
}

.slot-info {
    display: flex;
    flex-direction: column;
    gap: 8px;

    padding-bottom: 17px;

    border-bottom: 1px solid #edf0f4;
}

.slot-info-row {
    display: flex;
    justify-content: space-between;

    font-size: 13px;
}

.slot-info-row span:first-child {
    color: #8992a3;
}

.slot-info-row span:last-child {
    color: #364152;
    font-weight: 700;
}


/* ---------- Slot Actions ---------- */

.slot-actions {
    display: flex;
    gap: 8px;

    margin-top: 16px;
}

.slot-actions button {
    flex: 1;

    border: none;

    padding: 9px 8px;

    border-radius: 7px;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition: all 0.2s ease;
}

.slot-actions .toggle-btn {
    background: #eff6ff;
    color: #2563eb;
}

.slot-actions .toggle-btn:hover {
    background: #dbeafe;
}

.slot-actions .delete-btn {
    background: #fef2f2;
    color: #dc2626;
}

.slot-actions .delete-btn:hover {
    background: #fee2e2;
}


/* ---------- Empty State ---------- */

.empty-state {
    grid-column: 1 / -1;

    text-align: center;

    padding: 65px 20px;

    color: #8992a3;
}

.empty-state h3 {
    color: #4b5565;

    font-size: 17px;

    margin-bottom: 7px;
}

.empty-state p {
    font-size: 13px;
}


/* ---------- Modal ---------- */

.modal {
    display: none;

    position: fixed;

    inset: 0;

    background: rgba(15, 23, 42, 0.48);

    backdrop-filter: blur(3px);

    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 1000;
}

.modal.show {
    display: flex;
}


/* ---------- Modal Content ---------- */

.modal-content {
    width: 100%;
    max-width: 440px;

    background: #ffffff;

    border-radius: 16px;

    padding: 28px;

    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.18);

    animation: modalOpen 0.2s ease;
}

@keyframes modalOpen {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

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


/* ---------- Modal Header ---------- */

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 21px;
    font-weight: 800;
}

.close-btn {
    width: 32px;
    height: 32px;

    border: none;

    background: #f3f4f6;

    color: #697386;

    border-radius: 7px;

    font-size: 21px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #e5e7eb;
    color: #172033;
}


/* ---------- Form ---------- */

#slotForm {
    display: flex;
    flex-direction: column;
}

#slotForm label {
    font-size: 13px;

    font-weight: 700;

    color: #374151;

    margin-bottom: 7px;
}

#slotForm input,
#slotForm select {
    width: 100%;

    height: 44px;

    border: 1px solid #dce1e9;

    border-radius: 8px;

    padding: 0 13px;

    background: #ffffff;

    color: #172033;

    font-size: 14px;

    outline: none;

    margin-bottom: 18px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#slotForm input::placeholder {
    color: #a0a8b6;
}

#slotForm input:focus,
#slotForm select:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}


/* ---------- Submit Button ---------- */

.submit-btn {
    height: 44px;

    border: none;

    border-radius: 8px;

    background: #2563eb;

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    margin-top: 3px;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.submit-btn:hover {
    background: #1d4ed8;
}

.submit-btn:active {
    transform: scale(0.99);
}


/* ---------- Loading ---------- */

.loading {
    grid-column: 1 / -1;

    text-align: center;

    padding: 50px;

    color: #7a8496;

    font-size: 14px;
}


/* ---------- Error Message ---------- */

.error-message {
    grid-column: 1 / -1;

    padding: 15px;

    border-radius: 9px;

    background: #fef2f2;

    border: 1px solid #fecaca;

    color: #b91c1c;

    font-size: 13px;

    text-align: center;
}


/* ---------- Responsive Tablet ---------- */

@media (max-width: 900px) {

    .navbar {
        padding: 0 5%;
    }

    main {
        width: 90%;
        padding-top: 38px;
    }

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

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

}


/* ---------- Responsive Mobile ---------- */

@media (max-width: 600px) {

    .navbar {
        height: 64px;
    }

    .logo {
        font-size: 19px;
    }

    .navbar nav {
        gap: 17px;
    }

    .navbar nav a {
        font-size: 12px;
        padding: 22px 0;
    }

    main {
        width: 92%;
        padding: 30px 0 50px;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

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

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

    .add-btn {
        width: 100%;
    }

    .parking-section {
        padding: 20px;
    }

    .section-header {
        align-items: flex-start;
        gap: 15px;
    }

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

    .modal-content {
        padding: 23px;
    }

}


/* ---------- Small Mobile ---------- */

@media (max-width: 400px) {

    .navbar nav a:nth-child(2) {
        display: none;
    }

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

    .stat-card {
        padding: 19px;
    }

    .parking-section {
        padding: 16px;
    }

}
