:root {
    --primary-color: #0f172a;
    --secondary-color: #1e293b;
    --accent-color: #3b82f6;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success-color: #10b981;
    --error-color: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans Malayalam', sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header h1 {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Responsive grid */
    gap: 1rem;
}

@media (max-width: 640px) {
    .checkbox-group {
        grid-template-columns: 1fr;
        /* Force 1 column on mobile for better readability */
    }
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    height: 100%;
    /* Full height of grid cell */
    justify-content: flex-start;
    min-height: 60px;
    height: auto;
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.checkbox-item input[type="checkbox"] {
    accent-color: var(--accent-color);
    width: 1.1em;
    height: 1.1em;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.stall-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stall-counter {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.stall-counter label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.declaration {
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 0.5rem;
    border-left: 4px solid var(--accent-color);
}

.declaration label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.declaration input[type="checkbox"] {
    margin-top: 0.25rem;
    accent-color: var(--accent-color);
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
        margin: 1rem auto;
    }

    .card {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .stall-types {
        grid-template-columns: 1fr;
    }

    /* Mobile Dashboard Adjustments */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .dashboard-header .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .header-actions .btn {
        width: auto !important;
        /* Prevent full width if not needed, or keep 100 on very small? */
        flex: 1;
    }
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-header h1 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.25rem;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    height: fit-content;
    white-space: nowrap;
    /* Prevent line break */
    min-width: 120px;
    /* Equal size */
    display: flex;
    /* For centering if needed */
    justify-content: center;
    align-items: center;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}


/* Table Styles for Admin */
.table-responsive {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-color);
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: rgba(15, 23, 42, 0.8);
    font-weight: 600;
    color: var(--text-muted);
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Admin Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.8);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(to bottom right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card p {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

/* Enhanced Table */
.card {
    border-top: 4px solid var(--accent-color);
    /* Accent top border */
}

table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    /* Space between rows */
}

thead th {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border: none;
}

tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.005);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

td {
    border: none;
    padding: 1rem;
}

/* First and Last child rounding for separate rows */
tbody tr td:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

tbody tr td:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.5rem;
    border-radius: 9999px;
    /* Pill shape */
}

.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: white;
}

.close-modal {
    color: var(--text-muted);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
}

.modal-body ol {
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.75rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}