/* 
   Luxury Modern Design System 
   Designed by Antigravity for Jayasinghe Tours
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #0a0c10;
    --bg-surface: #12151c;
    --bg-card: rgba(15, 23, 42, 0.6); /* Changed to dark semi-transparent for better contrast */
    
    --primary: #818cf8; /* Lightened blue/indigo for better visibility on dark */
    --primary-glow: rgba(129, 140, 248, 0.2);
    --secondary: #94a3b8;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lux: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(99, 102, 241, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overscroll-behavior-y: none; /* Helps keep fixed elements steady */
}

main {
    flex: 1 0 auto;
}

h1, h2, h3, h4, .font-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Glassmorphism */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.glass-hover:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lux);
}

/* Layout */
.container {
    max-width: 1600px; /* Expanded layout to fit full tables comfortably */
    margin: 0 auto;
    padding: 0 40px;
}

.page-container {
    padding-top: 100px; /* Standardize distance from fixed header */
    padding-bottom: 60px;
    min-height: calc(100vh - 80px);
}

.form-container-centered {
    max-width: 800px;
    margin: 0 auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Navigation */
.nav-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 12, 16, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link i {
    font-size: 18px;
    transition: var(--transition);
}

.nav-link:hover i {
    transform: rotate(10deg) scale(1.1);
    color: var(--primary);
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #0a0c10;
    border-top: 1px solid var(--border);
    padding: 12px 0;
    z-index: 9999; /* Maximized for stability */
    justify-content: space-around;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    transform: translate3d(0,0,0); /* Hardware acceleration for 'steady' feel */
    -webkit-transform: translate3d(0,0,0);
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.mobile-nav-link i {
    width: 20px;
    height: 20px;
}

.mobile-nav-link.active {
    color: var(--primary);
}

/* Cards & Containers */
.card {
    padding: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lux);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    display: block; /* Ensure it behaves as a block */
    width: 100%;
}

.history-scroll {
    max-height: calc(100vh - 420px); 
    min-height: 400px;
    overflow: auto !important;
    scrollbar-gutter: stable;
    position: relative;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 140, 248, 0.5) rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 20px 20px -20px rgba(0,0,0,0.5);
    margin: 0 -24px -24px -24px;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.history-scroll .table-container {
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    width: 100%;
}

.history-scroll table {
    border-top: none;
}

.history-scroll th {
     background: rgba(15, 23, 42, 0.95);
     backdrop-filter: blur(12px);
     color: #cbd5e1;
     font-weight: 700;
     border-bottom: 2px solid var(--primary-glow);
     box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Professional Custom Scrollbar - More Visible */
.history-scroll::-webkit-scrollbar {
    width: 8px; /* Slightly wider */
    height: 8px;
}

.history-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.history-scroll::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.5); /* More opaque */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.history-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    background-clip: content-box;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 16px 16px;
    background: var(--bg-surface);
    color: var(--primary);
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 13.5px;
    color: var(--text-main);
    transition: var(--transition);
}

tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.015);
}

tr:hover td {
    background: rgba(129, 140, 248, 0.08) !important;
    color: var(--text-main);
}

/* Mobile Table Cards */
@media (max-width: 640px) {
    .history-scroll .table-container { min-width: auto; }
    .table-container { border: none; background: transparent; }
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { position: absolute; top: -9999px; left: -9999px; }
    
    tr {
        background: var(--bg-surface);
        margin-bottom: 16px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 12px;
        box-shadow: var(--shadow-soft);
    }
    
    td {
        border-bottom: 1px solid rgba(255,255,255,0.05);
        position: relative;
        padding: 12px 12px 12px 40% !important;
        text-align: right;
        min-height: 48px;
    }
    
    td:last-child { border-bottom: none; }
    
    td:before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        width: 35%;
        text-align: left;
        font-weight: 700;
        color: var(--text-muted);
        font-size: 11px;
        text-transform: uppercase;
    }
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05); /* Increased slightly */
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

select option {
    background: var(--bg-surface);
    color: var(--text-main);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08); /* Increased for focus */
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

/* Alerts & Notifications */
.alert {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid transparent;
}

.alert-error { background: rgba(239, 68, 68, 0.1); border-color: var(--error); color: #fca5a5; }
.alert-success { background: rgba(16, 185, 129, 0.1); border-color: var(--success); color: #6ee7b7; }
.alert-warning { background: rgba(245, 158, 11, 0.1); border-color: var(--warning); color: #fcd34d; }

/* Custom Components */
.luxury-badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.luxury-badge.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

.luxury-badge.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.luxury-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.luxury-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* Floating Actions */
.floating-footer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .nav-links { display: none !important; } /* Hide top nav */
    .mobile-bottom-nav { display: flex; } /* Show bottom nav */
    
    .nav-header { padding: 0 20px; height: 64px; }
    .nav-logo h1 { font-size: 18px; margin: 0 auto; } /* Center logo */
    
    /* Professional Offset Alignment - Little bit right */
    .container {
        padding-left: 24px;
        padding-right: 16px;
    }
    
    .page-container { padding-top: 80px; padding-bottom: 100px; }
    .form-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .card { padding: 20px; }
    
    .font-heading { font-size: 24px !important; }
    p { font-size: 13px; }
}
