/* CSS Stylesheet for ASMParking */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #0b0f19;
    --bg-surface: #151d30;
    --bg-surface-elevated: #1e2942;
    --primary: #4f46e5; /* Purple primary */
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --accent: #06b6d4; /* Cyan accent */
    --accent-glow: rgba(6, 182, 212, 0.2);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --border-color: rgba(255, 255, 255, 0.08);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
}

/* User Interface Header/Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(21, 29, 48, 0.7);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand::before {
    content: '⚡';
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.card-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.card-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

/* Custom Terms Area */
.terms-box {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    height: 150px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.terms-box h4 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-group label {
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Capacity indicators */
.capacity-widget {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.capacity-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.capacity-badge {
    background: var(--success-glow);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.capacity-badge.full {
    background: var(--danger-glow);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.full-alert {
    background: var(--danger-glow);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
    line-height: 1.5;
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: var(--bg-surface-elevated);
    padding: 1rem;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.95rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-danger {
    background: var(--danger-glow);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning {
    background: var(--warning-glow);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Search Box */
.search-box {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
}

/* Result Screens */
.result-screen {
    text-align: center;
    padding: 3rem 1.5rem;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.result-success .result-icon {
    color: var(--success);
}

.result-failed .result-icon {
    color: var(--danger);
}

.result-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.result-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.result-details {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 0 auto 2.5rem auto;
    max-width: 500px;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row span:first-child {
    color: var(--text-muted);
}

.detail-row span:last-child {
    font-weight: 600;
    color: var(--text-main);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1.2rem 1rem;
    }
    
    .nav-brand {
        font-size: 1.35rem;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .container {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .card-title {
        font-size: 1.6rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .search-box .btn {
        width: 100%;
    }
}


/* ==========================================================================
   Admin Page Layout (Light Sidebar Dashboard matching ASM Control layout)
   ========================================================================== */
body.admin-page {
    background-color: #f3f4f6; /* Soft light-blueish gray base */
    color: #1e293b;
    font-weight: 300;
    background-image: none;
    min-height: 100vh;
    display: flex;
    flex-direction: row; /* Sidebar + Content Side-by-side */
    overflow-x: hidden;
}

body.admin-page * {
    font-weight: 300;
}

body.admin-page strong, 
body.admin-page b, 
body.admin-page h1, 
body.admin-page h2, 
body.admin-page h3, 
body.admin-page th,
body.admin-page button,
body.admin-page label {
    font-weight: 400;
}

body.admin-page h1.card-title,
body.admin-page h2.card-title {
    font-weight: 500;
}

/* Sidebar Styling (Dark Theme left panel) */
.admin-sidebar {
    width: 260px;
    background-color: #0b0f19; /* Sleek dark blue from image */
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: 1.8rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo::before {
    content: '⚙️';
    font-size: 1.1rem;
}

.sidebar-status {
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 2px;
}

.sidebar-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    border-radius: 12px;
    transition: var(--transition);
}

.sidebar-item a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-item.active a {
    color: #ffffff;
    background-color: #4f46e5; /* Purple pill background */
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Main Dashboard Panel */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Topbar Styling (White background) */
.admin-topbar {
    background-color: #ffffff;
    height: 70px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.admin-breadcrumbs {
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.admin-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
}

.admin-breadcrumbs span.sep {
    color: #cbd5e1;
}

.admin-breadcrumbs span.current {
    background-color: #e0e7ff;
    color: #4f46e5;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-dropdown {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 400;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Content Container overrides */
body.admin-page .container {
    max-width: 100%;
    margin: 0;
    padding: 2rem;
}

.admin-header-section {
    margin-bottom: 2rem;
}

.admin-header-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.admin-header-section p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Cards overrides (White, subtle shadow, colored bullet) */
body.admin-page .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.03);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

body.admin-page .card::before {
    display: none; /* Remove background top line gradient */
}

body.admin-page .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

body.admin-page .card-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Bullet colors in cards matching image list */
.card-bullet-purple .card-title::before { background-color: #8b5cf6; }
.card-bullet-green .card-title::before { background-color: #10b981; }
.card-bullet-red .card-title::before { background-color: #ef4444; }
.card-bullet-blue .card-title::before { background-color: #3b82f6; }

/* Stat Widgets override */
body.admin-page .admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

body.admin-page .stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: none; /* Remove left colored border */
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}

body.admin-page .stat-card .label {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

body.admin-page .stat-card .value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #0f172a;
}

/* Forms override */
body.admin-page .form-label {
    color: #475569;
}

body.admin-page .form-control {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.admin-page .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Table light theme styling overrides */
body.admin-page th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

body.admin-page td {
    color: #334155;
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

body.admin-page tr:hover td {
    background: #f8fafc;
    color: #0f172a;
}

/* Custom badge styling */
body.admin-page .badge-success {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

body.admin-page .badge-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

body.admin-page .badge-warning {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

body.admin-page footer {
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
    background-color: #ffffff;
    padding: 1.5rem;
}

/* Mobile adjustments for Light Sidebar admin panel */
@media (max-width: 992px) {
    body.admin-page {
        flex-direction: column; /* Stack sidebar on top on tablet/mobile */
    }
    
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }
    
    .sidebar-item a {
        white-space: nowrap;
        padding: 0.6rem 0.9rem;
    }
    
    body.admin-page .container {
        padding: 1.2rem;
    }
    
    .admin-topbar {
        padding: 0 1.2rem;
    }
}

/* ==========================================================================
   Payment Modal Dialog Rules (Responsive iframe modal)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 700px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 0;
    background: #ffffff;
}

body.admin-page .modal-content {
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

body.admin-page .modal-header h3 {
    color: #0f172a;
}

body.admin-page .modal-header {
    border-bottom: 1px solid #cbd5e1;
    background: #f8fafc;
}

/* Pulse Dot Animation for Custom QR Payment Modal */
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--warning);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: pulse-animation 1.6s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}
