/**
 * FLIGHT FOR YOU — Professional Theme Stylesheet
 * Brand Colors: Deep Navy (#0B192C), Slate Teal (#028090), Emerald (#059669)
 */

:root {
    --ffy-primary: #0B192C;
    --ffy-primary-light: #1E3E62;
    --ffy-teal: #028090;
    --ffy-teal-light: #00A896;
    --ffy-teal-subtle: #f0fdfa;
    --ffy-accent: #F59E0B;
    --ffy-success: #10B981;
    --ffy-danger: #EF4444;
    --ffy-body-bg: #F8FAFC;
    --ffy-card-bg: #FFFFFF;
    --ffy-text: #0F172A;
    --ffy-text-muted: #64748B;
    --ffy-border: #E2E8F0;
    --ffy-sidebar-width: 260px;
    --ffy-bottom-nav-height: 64px;
}

body {
    background-color: var(--ffy-body-bg);
    color: var(--ffy-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography & Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--ffy-primary);
    font-weight: 700;
}

/* Sidebar for Desktop */
.app-wrapper {
    display: flex;
    flex: 1;
    min-height: 100vh;
}

.sidebar {
    width: var(--ffy-sidebar-width);
    background-color: var(--ffy-primary);
    color: #F8FAFC;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease-in-out;
    z-index: 1040;
}

.sidebar .brand-container {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #FFFFFF;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .brand-title .plane-icon {
    color: var(--ffy-teal-light);
}

.sidebar .nav-link {
    color: #94A3B8;
    padding: 0.7rem 1.25rem;
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.06);
    border-left-color: var(--ffy-teal-light);
}

.sidebar .nav-link i {
    font-size: 1.15rem;
    color: var(--ffy-teal-light);
}

.sidebar .sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.75px;
    color: #64748B;
    padding: 1rem 1.25rem 0.4rem;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-bottom: calc(var(--ffy-bottom-nav-height) + 1.5rem);
}

@media (min-width: 992px) {
    .main-content {
        padding-bottom: 2rem;
    }
}

/* Top Navbar */
.top-navbar {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--ffy-border);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Cards & Financial Summaries */
.stat-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid var(--ffy-border);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(11, 25, 44, 0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card .stat-icon.primary { background: #E2E8F0; color: var(--ffy-primary); }
.stat-card .stat-icon.teal { background: #CCFBF1; color: var(--ffy-teal); }
.stat-card .stat-icon.success { background: #D1FAE5; color: var(--ffy-success); }
.stat-card .stat-icon.warning { background: #FEF3C7; color: var(--ffy-accent); }
.stat-card .stat-icon.danger { background: #FEE2E2; color: var(--ffy-danger); }

.stat-card .stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ffy-text-muted);
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ffy-primary);
    margin-top: 0.25rem;
}

/* Custom Financial Tables */
.table-custom {
    background: #FFFFFF;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ffy-border);
}

.table-custom th {
    background: #F8FAFC;
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--ffy-border);
}

.table-custom td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--ffy-border);
}

.table-custom tbody tr:hover {
    background-color: #F8FAFC;
}

/* Badges */
.badge-status {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-paid { background: #DCFCE7; color: #15803D; }
.badge-pending { background: #FEF3C7; color: #B45309; }
.badge-partially { background: #E0E7FF; color: #4338CA; }
.badge-cancelled { background: #FEE2E2; color: #B91C1C; }
.badge-issued { background: #CCFBF1; color: #0F766E; }

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--ffy-bottom-nav-height);
    background: #FFFFFF;
    border-top: 1px solid var(--ffy-border);
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -100%;
        box-shadow: 2px 0 16px rgba(0,0,0,0.25);
    }
    .sidebar.show {
        left: 0;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
        display: none;
    }
    .sidebar-backdrop.show {
        display: block;
    }
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748B;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px 0;
    transition: color 0.15s;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:hover {
    color: var(--ffy-teal);
}

/* Floating Fahad AI Trigger Button */
.fahad-ai-fab {
    position: fixed;
    bottom: calc(var(--ffy-bottom-nav-height) + 16px);
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ffy-primary) 0%, var(--ffy-teal) 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 15px rgba(2, 128, 144, 0.35);
    cursor: pointer;
    z-index: 1025;
    border: 2px solid #FFFFFF;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 992px) {
    .fahad-ai-fab {
        bottom: 24px;
        right: 28px;
    }
}

.fahad-ai-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(2, 128, 144, 0.45);
    color: #FFFFFF;
}

.fahad-ai-fab .pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--ffy-teal-light);
    animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Fahad Chat Offcanvas */
.fahad-chat-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.fahad-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.chat-bubble.model {
    background: #F1F5F9;
    color: var(--ffy-text);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-bubble.user {
    background: var(--ffy-teal);
    color: #FFFFFF;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.fahad-quick-chip {
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 16px;
    background: #E2E8F0;
    color: #334155;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.fahad-quick-chip:hover {
    background: var(--ffy-teal);
    color: #FFFFFF;
}

/* Offline Banner */
.offline-banner {
    display: none;
    background: #EF4444;
    color: #FFFFFF;
    text-align: center;
    font-size: 0.85rem;
    padding: 4px;
    font-weight: 600;
}

/* Print Styles */
@media print {
    .sidebar, .top-navbar, .mobile-bottom-nav, .fahad-ai-fab, .btn, .no-print {
        display: none !important;
    }
    .main-content {
        padding: 0 !important;
    }
}
