/* ============================================================
   style.css — Hall Booking System Custom Styles
   ============================================================ */

/* ---- CSS Variables for Theming ---- */
:root {
    --bg-primary: #0f0e17;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-primary: #a855f7;
    --accent-secondary: #ec4899;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.1);
}

/* Light mode overrides */
.light-mode {
    --bg-primary: #f0f0f5;
    --bg-secondary: #e5e5ec;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1a1a2e;
    --text-secondary: rgba(0, 0, 0, 0.6);
    --text-muted: rgba(0, 0, 0, 0.35);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Animated Background ---- */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(236, 72, 153, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    animation: meshFloat 20s ease-in-out infinite;
}

.light-mode .bg-mesh {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(168, 85, 247, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(236, 72, 153, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
}

@keyframes meshFloat {
    0%, 100% { transform: scale(1) translate(0, 0); }
    33% { transform: scale(1.05) translate(10px, -10px); }
    66% { transform: scale(0.95) translate(-10px, 10px); }
}

/* ---- Glass Card ---- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.15);
}

.light-mode .glass-card {
    background: var(--glass-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.light-mode .glass-card:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ---- Form Inputs ---- */
.form-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.light-mode .form-input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

.light-mode .form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23999'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
    padding-right: 2rem;
}

select.form-input option {
    background: #1a1a2e;
    color: white;
}

.light-mode select.form-input option {
    background: #ffffff;
    color: #1a1a2e;
}

/* ---- Navigation ---- */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(15, 14, 23, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.375rem 0;
    padding-bottom: max(0.375rem, env(safe-area-inset-bottom));
}

.light-mode .nav-bottom {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(0, 0, 0, 0.08);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:hover {
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--accent-primary);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-item .nav-icon {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.nav-item .nav-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---- Header ---- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(15, 14, 23, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.light-mode .app-header {
    background: rgba(240, 240, 245, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* ---- Search filter buttons ---- */
.search-filter-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.search-filter-btn.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    color: #a855f7;
}

.light-mode .search-filter-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-muted);
}

.light-mode .search-filter-btn.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    color: #9333ea;
}

/* ---- Status Badge ---- */
.status-badge {
    white-space: nowrap;
}

.light-mode .status-badge {
    font-weight: 700;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fadeIn { animation: fadeIn 0.3s ease-out; }
.animate-slideUp { animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-scaleIn { animation: scaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1); }

/* ---- Toast Container ---- */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

#toast-container > * {
    pointer-events: auto;
}

/* ---- Page Content ---- */
.page-section {
    animation: fadeIn 0.25s ease-out;
}

.page-section.hidden {
    display: none !important;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

/* ---- Booking Card ---- */
.booking-card {
    transition: all 0.2s ease;
}

.booking-card:active {
    transform: scale(0.98);
}

/* ---- Footer ---- */
.app-footer {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 1rem;
}

.app-footer a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.app-footer a:hover {
    color: var(--accent-secondary);
}

/* ---- Loading Spinner ---- */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(168, 85, 247, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Responsive ---- */
@media (min-width: 640px) {
    .nav-bottom {
        padding: 0.5rem;
    }
}

/* ---- Light Mode Text Overrides ---- */
.light-mode .text-white {
    color: var(--text-primary) !important;
}

.light-mode .text-white\/70,
.light-mode .text-white\/60 {
    color: var(--text-secondary) !important;
}

.light-mode .text-white\/50,
.light-mode .text-white\/40 {
    color: var(--text-muted) !important;
}

.light-mode .bg-white\/10 {
    background-color: rgba(0, 0, 0, 0.06) !important;
}

.light-mode .bg-white\/5 {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

.light-mode .hover\:bg-white\/20:hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

.light-mode .border-white\/10 {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.light-mode .border-white\/20 {
    border-color: rgba(0, 0, 0, 0.12) !important;
}
