/**
 * Copyright (c) 2025-2026 1ai.dev
 * Developed with ❤️ by A.K.Mishra
 * 
 * This file is part of the Travelling Buddies project.
 * See LICENSE file for license information.
 */
/**
 * Travelling Buddies - Custom Brand Styles
 * "Curating authentic, community-style backpacking experiences"
 * 
 * @package TravellingBuddies
 * @version 1.0.0
 */

/* ============================================
   CSS VARIABLES - Brand Colors
   ============================================ */
:root {
    /* Brand Colors */
    --tb-primary: #264653;       /* Deep Moss */
    --tb-secondary: #2A9D8F;     /* Sage */
    --tb-success: #2A9D8F;       /* Sage (Green Score) */
    --tb-danger: #E76F51;        /* Terracotta (Alerts/Delete) */
    --tb-warning: #E9C46A;       /* Sandstone (Warnings/Waitlist) */
    --tb-info: #8AB17D;          /* Light Green */
    
    /* Body & Text */
    --tb-body-bg: #F4F1DE;       /* Parchment */
    --tb-body-color: #333333;    /* Charcoal */
    --tb-card-bg: #FFFFFF;
    
    /* Fonts */
    --tb-font-sans-serif: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --tb-font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Override Bootstrap variables */
    --bs-primary: var(--tb-primary);
    --bs-secondary: var(--tb-secondary);
    --bs-success: var(--tb-success);
    --bs-danger: var(--tb-danger);
    --bs-warning: var(--tb-warning);
    --bs-info: var(--tb-info);
    --bs-body-bg: var(--tb-body-bg);
    --bs-body-color: var(--tb-body-color);
    --bs-font-sans-serif: var(--tb-font-sans-serif);

    /* Bootstrap's *-bg-subtle and *-text-emphasis tokens are precomputed
       (generic blue) and are NOT derived from --bs-primary, so subtle
       badges/chips (bg-primary-subtle, text-info-emphasis, etc.) render
       off-brand blue. Re-derive them from the brand palette. */
    --bs-primary-bg-subtle: #dbe4e7;
    --bs-secondary-bg-subtle: #d6ece8;
    --bs-success-bg-subtle: #d6ece8;
    --bs-info-bg-subtle: #e6efe1;
    --bs-warning-bg-subtle: #fbf2d8;
    --bs-danger-bg-subtle: #fbe1da;
    --bs-primary-text-emphasis: #1a3440;
    --bs-secondary-text-emphasis: #1f6f64;
    --bs-success-text-emphasis: #1f6f64;
    --bs-info-text-emphasis: #4d6b42;
    --bs-warning-text-emphasis: #8a6d2f;
    --bs-danger-text-emphasis: #b34a34;

    /* Brand links (deep teal keeps >=10:1 contrast on white for WCAG AA;
       avoids generic Bootstrap blue across the app) */
    --bs-link-color: var(--tb-primary);
    --bs-link-color-rgb: 38, 70, 83;
    --bs-link-hover-color: #1e3a47;
    --bs-link-hover-color-rgb: 30, 58, 71;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
body {
    font-family: var(--tb-font-sans-serif);
    background-color: var(--tb-body-bg);
    color: var(--tb-body-color);
}

/* Utility: allow flex children to shrink so .text-truncate works inside
   flex/grid rows (Bootstrap ships no min-width-0 helper). Used widely by
   member chips, list rows, card metadata, etc. */
.min-width-0 { min-width: 0 !important; }

/* AdminKit's .stat icon chip is hardcoded light blue (#d3e2f7) with a blue
   svg; neutralize to a brand-tinted surface and let the icon colour follow
   the text-* utility (keeps dashboard/carbon stat chips on-brand). */
.stat { background-color: #e7eeec !important; }
.stat svg { color: inherit !important; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--tb-font-heading);
    color: var(--tb-primary);
    font-weight: 700;
}

.lead {
    font-weight: 400;
    color: var(--tb-body-color);
}

/* ============================================
   SIDEBAR CUSTOMIZATION
   ============================================ */
.sidebar {
    background: linear-gradient(180deg, var(--tb-primary) 0%, #1a3440 100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    margin-right: 0.75rem;
    border-radius: 8px;
}

.sidebar-brand .brand-text {
    font-family: var(--tb-font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    color: #fff;
}

.sidebar-brand .brand-text small {
    font-weight: 400;
    font-size: 0.9rem;
    opacity: 0.8;
}

.sidebar-nav .sidebar-item.active > .sidebar-link {
    background: rgba(42, 157, 143, 0.25);
    border-left: 3px solid var(--tb-secondary);
    color: #fff; /* UX-004: Ensure high contrast text */
}

.sidebar-nav .sidebar-item.active > .sidebar-link span {
    color: #fff;
    font-weight: 600;
}

.sidebar-nav .sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-cta {
    margin: 1.5rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-cta-content {
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   NAVBAR CUSTOMIZATION
   ============================================ */
.navbar-bg {
    background: var(--tb-card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.input-group-navbar {
    background: #f1f3f4;
    border: 1px solid rgba(38, 70, 83, 0.12);
    border-radius: 20px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-group-navbar:focus-within {
    border-color: var(--tb-secondary);
    box-shadow: 0 0 0 0.18rem rgba(42, 157, 143, 0.18);
}

.input-group-navbar .form-control {
    background: transparent;
    border: none;
}

.input-group-navbar .form-control:focus {
    box-shadow: none;
}

.input-group-navbar .btn {
    background: transparent;
    color: var(--tb-primary);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background-color: var(--tb-card-bg);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
}

.card-title {
    color: var(--tb-primary);
    font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background-color: var(--tb-primary);
    border-color: var(--tb-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #1e3a47;
    border-color: #1e3a47;
}

.btn-secondary {
    background-color: var(--tb-secondary);
    border-color: var(--tb-secondary);
}

/* Amber is a light surface: force dark text/icons for WCAG contrast */
.btn-warning,
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    color: #1a1a1a;
}

.btn-cta {
    background: linear-gradient(135deg, var(--tb-danger) 0%, #d45a3f 100%);
    color: white;
    font-weight: 700;
    border-radius: 50px;
    padding: 12px 28px;
    border: none;
    box-shadow: 0 4px 15px rgba(231, 111, 81, 0.35);
    transition: all 0.3s ease;
}

.btn-cta:hover {
    background: linear-gradient(135deg, #d45a3f 0%, var(--tb-danger) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 111, 81, 0.45);
}

.btn-outline-primary {
    color: var(--tb-primary);
    border-color: var(--tb-primary);
}

.btn-outline-primary:hover {
    background-color: var(--tb-primary);
    border-color: var(--tb-primary);
}

/* ============================================
   TRIP CARDS
   ============================================ */
.trip-card {
    overflow: hidden;
    transition: transform 0.3s ease;
}

.trip-card:hover {
    transform: translateY(-5px);
}

.trip-card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.trip-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.trip-card:hover .trip-card-image img {
    transform: scale(1.1);
}

.green-score-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(42, 157, 143, 0.95);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.green-score-badge svg {
    width: 14px;
    height: 14px;
}

.difficulty-badge,
.role-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-easy {
    background: var(--tb-success);
    color: white;
}

.difficulty-moderate {
    background: var(--tb-info);
    color: white;
}

.difficulty-challenging {
    background: var(--tb-warning);
    color: var(--tb-body-color);
}

.difficulty-extreme {
    background: var(--tb-danger);
    color: white;
}

.trip-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tb-primary);
}

.trip-price-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--tb-primary);
}

.trip-card-past {
    opacity: 0.85;
}

.trip-card-past .trip-card-image img {
    filter: grayscale(30%);
}

/* ============================================
   TRIP DETAIL PAGE
   ============================================ */
.trip-header {
    margin: -1.5rem -1.5rem 0;
}

.trip-cover-image {
    height: 420px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.trip-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(38, 70, 83, 0.96) 0%, rgba(38, 70, 83, 0.78) 35%, rgba(38, 70, 83, 0.4) 65%, rgba(38, 70, 83, 0.15) 100%);
    display: flex;
    align-items: flex-end;
    /* Ensure content isn't hidden under navbar */
    padding-top: 70px;
}

.trip-cover-overlay h1,
.trip-cover-overlay p,
.trip-cover-overlay .breadcrumb-light {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.trip-meta .badge {
    font-size: 0.8rem;
    padding: 6px 12px;
}

.trip-price-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
}

.price-label {
    font-size: 0.8rem;
    color: var(--tb-body-color);
    opacity: 0.7;
}

.price-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tb-primary);
}

.green-score {
    font-size: 0.85rem;
    color: var(--tb-success);
}

/* AdminKit's bundled CSS omits Bootstrap's breadcrumb component, so plain
   <ol class="breadcrumb"> elements rendered raw list numbers stacked
   vertically. Restore the expected flex layout + "/" divider globally. */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0;
    margin-bottom: 1rem;
    list-style: none;
}
.breadcrumb-item + .breadcrumb-item {
    padding-left: 0.5rem;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: var(--bs-breadcrumb-divider, "/");
    float: left;
    padding-right: 0.5rem;
    color: var(--bs-breadcrumb-divider-color, #6c757d);
}
.breadcrumb-item.active {
    color: var(--bs-secondary-color, #6c757d);
}

.breadcrumb-light {
    background: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.breadcrumb-light .breadcrumb-item,
.breadcrumb-light .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.85);
}

.breadcrumb-light .breadcrumb-item.active {
    color: #ffffff;
}

.breadcrumb-light .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding-right: 0.25rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   GREEN SCORE CIRCLE
   ============================================ */
.green-score-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tb-success) 0%, var(--tb-info) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.green-score-circle .score {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.green-score-circle .max {
    font-size: 1rem;
    opacity: 0.8;
}

/* ============================================
   MEMORIES / ON THIS DAY
   ============================================ */
.memory-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.memory-item:last-child {
    border-bottom: none;
}

.memory-year-badge {
    background: var(--tb-body-bg);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    min-width: 60px;
}

.memory-year-badge .years-ago {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--tb-primary);
    line-height: 1;
}

.memory-year-badge .years-text {
    font-size: 0.65rem;
    color: var(--tb-body-color);
    opacity: 0.6;
}

/* ============================================
   WELCOME BANNER
   ============================================ */
.welcome-banner {
    background: linear-gradient(135deg, var(--tb-primary) 0%, #1a3a47 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.welcome-banner h1 {
    color: white;
}

.welcome-banner .text-muted {
    color: rgba(255, 255, 255, 0.9) !important;
}

.welcome-logo {
    max-height: 100px;
    filter: brightness(0) invert(1);
    opacity: 0.3;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stat {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.stat-primary {
    background: rgba(38, 70, 83, 0.1);
    color: var(--tb-primary);
}

.stat-info {
    background: rgba(138, 177, 125, 0.15);
    color: var(--tb-info);
}

.stat-warning {
    background: rgba(233, 196, 106, 0.2);
    color: #c9a657;
}

.stat-success {
    background: rgba(42, 157, 143, 0.15);
    color: var(--tb-success);
}

/* ============================================
   AVATAR
   ============================================ */
.avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tb-primary);
    color: white;
    font-weight: 600;
}

/* ============================================
   PACKING LIST
   ============================================ */
.packing-item {
    transition: background-color 0.2s ease;
}

.packing-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.packing-check:checked + div span:first-child {
    text-decoration: line-through;
    opacity: 0.6;
}

/* ============================================
   COUNTDOWN BADGE
   ============================================ */
.countdown-badge {
    font-size: 0.85rem;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--tb-danger);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.object-cover {
    object-fit: cover;
}

.text-primary {
    color: var(--tb-primary) !important;
}

.text-secondary {
    color: var(--tb-secondary) !important;
}

.text-success {
    color: var(--tb-success) !important;
}

.text-danger {
    color: var(--tb-danger) !important;
}

.text-warning {
    color: var(--tb-warning) !important;
}

.text-info {
    color: var(--tb-info) !important;
}

.bg-primary {
    background-color: var(--tb-primary) !important;
}

.bg-secondary {
    background-color: var(--tb-secondary) !important;
}

.bg-success {
    background-color: var(--tb-success) !important;
}

.bg-danger {
    background-color: var(--tb-danger) !important;
}

.bg-warning {
    background-color: var(--tb-warning) !important;
}

.bg-info {
    background-color: var(--tb-info) !important;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .trip-cover-image {
        height: 350px;
    }
    
    /* More padding on mobile for navbar */
    .trip-cover-overlay {
        padding-top: 60px;
    }
    
    /* Smaller trip title on mobile */
    .trip-cover-overlay h1 {
        font-size: 1.5rem;
    }
    
    .welcome-banner {
        padding: 1.5rem;
    }
    
    .trip-price-box {
        margin-top: 1rem;
    }
    
    .price-amount {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .sidebar-brand .brand-text {
        display: none;
    }
    
    .btn-cta {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
/* Bootstrap 5 Modal CSS - Manually added because app.css is missing it */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}
.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
}
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}
@media (prefers-reduced-motion: reduce) {
  .modal.fade .modal-dialog {
    transition: none;
  }
}
.modal.show .modal-dialog {
  transform: none;
}
.modal.modal-static .modal-dialog {
  transform: scale(1.02);
}
.modal-dialog-scrollable {
  height: calc(100% - 1rem);
}
.modal-dialog-scrollable .modal-content {
  max-height: 100%;
  overflow: hidden;
}
.modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}
.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  outline: 0;
}
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100vw;
  height: 100vh;
  background-color: #000;
}
.modal-backdrop.fade {
  opacity: 0;
}
.modal-backdrop.show {
  opacity: 0.5;
}
.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid #dee2e6;
  border-top-left-radius: calc(0.3rem - 1px);
  border-top-right-radius: calc(0.3rem - 1px);
}
.modal-header .btn-close {
  padding: 0.5rem 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
}
.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
}
.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid #dee2e6;
  border-bottom-right-radius: calc(0.3rem - 1px);
  border-bottom-left-radius: calc(0.3rem - 1px);
}
.modal-footer > * {
  margin: 0.25rem;
}
@media (min-width: 576px) {
  .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
  }
  .modal-dialog-scrollable {
    height: calc(100% - 3.5rem);
  }
  .modal-dialog-centered {
    min-height: calc(100% - 3.5rem);
  }
  .modal-sm {
    max-width: 300px;
  }
}
@media (min-width: 992px) {
  .modal-lg,
  .modal-xl {
    max-width: 800px;
  }
}
@media (min-width: 1200px) {
  .modal-xl {
    max-width: 1140px;
  }
}

/* ============================================
   ACCESSIBILITY - Focus Indicators (UX-005)
   ============================================ */
/* Enhanced focus indicators for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--tb-secondary);
    outline-offset: 2px;
}

/* Remove default outline when using mouse */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Specific focus styles for interactive elements */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--tb-secondary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.25);
}

.sidebar-link:focus-visible {
    outline: 2px solid var(--tb-secondary);
    outline-offset: -2px;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 2px solid var(--tb-secondary);
    outline-offset: -2px;
}

/* Card clickable focus */
.card[tabindex]:focus-visible {
    outline: 2px solid var(--tb-secondary);
    outline-offset: 2px;
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.2);
}

/* ============================================
   SKELETON LOADING STATES (UX-003)
   ============================================ */
/* Use these classes for loading placeholders while fetching data */

@keyframes skeleton-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(90deg, 
        var(--tb-border-color, #e9ecef) 0%, 
        #f8f9fa 50%, 
        var(--tb-border-color, #e9ecef) 100%);
    background-size: 200px 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.long { width: 100%; }

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-avatar.lg {
    width: 64px;
    height: 64px;
}

.skeleton-card {
    padding: 1.25rem;
    border-radius: var(--tb-border-radius, 12px);
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: var(--tb-border-radius, 12px);
}

/* Skeleton for trip cards */
.skeleton-trip-card .skeleton-image {
    height: 180px;
    margin-bottom: 1rem;
}

/* Hide skeleton when content is loaded */
.loaded .skeleton,
.loaded .skeleton-text,
.loaded .skeleton-avatar,
.loaded .skeleton-image {
    display: none;
}

/* Fade in actual content */
.skeleton-content {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loaded .skeleton-content {
    opacity: 1;
}

/* ============================================
   LOAD MORE / INFINITE SCROLL (UX-006)
   ============================================ */
.load-more-container {
    text-align: center;
    padding: 2rem 0;
}

.btn-load-more {
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-load-more:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-load-more:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-load-more .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Infinite scroll indicator */
.infinite-scroll-trigger {
    height: 1px;
    visibility: hidden;
}

.loading-more {
    text-align: center;
    padding: 2rem;
    color: var(--tb-text-muted);
}

.loading-more .spinner-border {
    width: 2rem;
    height: 2rem;
    color: var(--tb-secondary);
}

/* End of list message */
.end-of-list {
    text-align: center;
    padding: 1.5rem;
    color: var(--tb-text-muted);
    font-style: italic;
}

/* Mobile-specific: Show load more, hide pagination */
@media (max-width: 767.98px) {
    .pagination-desktop {
        display: none;
    }
    
    .load-more-mobile {
        display: block;
    }
}

@media (min-width: 768px) {
    .load-more-mobile {
        display: none;
    }
    
    .pagination-desktop {
        display: flex;
    }
}

/* ============================================
   ICON FIXES
   ============================================ */
/* Pre-replacement: Ensure i[data-feather] has dimensions before JS converts it */
i[data-feather] {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: transparent;
}

/* Force Feather Icons Size and Visibility globally */
svg.feather,
.feather {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 18px !important;
    height: 18px !important;
    stroke-width: 2 !important;
    stroke: currentColor !important;
    fill: none !important;
    vertical-align: middle !important;
}

/* Ensure SVG paths inside icons inherit stroke color */
svg.feather *,
.feather *,
svg.feather line,
svg.feather polyline,
svg.feather path,
svg.feather circle,
svg.feather rect,
svg.feather polygon {
    stroke: inherit !important;
    fill: none !important;
}

/* Button group icons - ultra high specificity */
.btn-group .btn .feather,
.btn-group .btn svg.feather,
.btn-group-sm .btn .feather,
.btn-group-sm .btn svg.feather,
.btn .feather,
.btn svg.feather,
button .feather,
button svg.feather {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 16px !important;
    height: 16px !important;
    stroke-width: 2 !important;
    fill: none !important;
    vertical-align: middle !important;
}

/* Explicit stroke colors for each button type in btn-group */
.btn-group .btn-outline-primary .feather,
.btn-group .btn-outline-primary svg.feather,
.btn-outline-primary .feather,
.btn-outline-primary svg.feather {
    stroke: #264653 !important;
}

.btn-group .btn-outline-secondary .feather,
.btn-group .btn-outline-secondary svg.feather,
.btn-outline-secondary .feather,
.btn-outline-secondary svg.feather {
    stroke: #6c757d !important;
}

.btn-group .btn-outline-warning .feather,
.btn-group .btn-outline-warning svg.feather,
.btn-outline-warning .feather,
.btn-outline-warning svg.feather {
    stroke: #D4A017 !important; /* Darker gold for visibility */
}

.btn-group .btn-outline-info .feather,
.btn-group .btn-outline-info svg.feather,
.btn-outline-info .feather,
.btn-outline-info svg.feather {
    stroke: #0dcaf0 !important;
}

.btn-group .btn-outline-danger .feather,
.btn-group .btn-outline-danger svg.feather,
.btn-outline-danger .feather,
.btn-outline-danger svg.feather {
    stroke: #E76F51 !important;
}

.btn-group .btn-outline-success .feather,
.btn-group .btn-outline-success svg.feather,
.btn-outline-success .feather,
.btn-outline-success svg.feather {
    stroke: #2A9D8F !important;
}

/* Solid/filled buttons - white icons */
.btn-primary .feather,
.btn-secondary .feather,
.btn-success .feather,
.btn-danger .feather,
.btn-info .feather,
.btn-dark .feather {
    stroke: #fff !important;
}

.btn-warning .feather,
.btn-light .feather {
    stroke: #212529 !important;
}

/* Table action buttons - highest specificity */
.table .btn-group .btn .feather,
.table .btn-group-sm .btn .feather,
.table td .btn .feather,
.table td button .feather {
    width: 16px !important;
    height: 16px !important;
}

.table .btn-outline-primary .feather { stroke: #264653 !important; }
.table .btn-outline-secondary .feather { stroke: #6c757d !important; }
.table .btn-outline-warning .feather { stroke: #D4A017 !important; }
.table .btn-outline-info .feather { stroke: #0dcaf0 !important; }
.table .btn-outline-danger .feather { stroke: #E76F51 !important; }
.table .btn-outline-success .feather { stroke: #2A9D8F !important; }

/* ============================================
   BADGE FIXES
   ============================================ */
/* Ensure background colors are applied correctly */
.bg-primary { background-color: var(--bs-primary) !important; color: #fff !important; }
.bg-secondary { background-color: var(--bs-secondary) !important; color: #fff !important; }
.bg-success { background-color: var(--bs-success) !important; color: #fff !important; }
.bg-info { background-color: var(--bs-info) !important; color: #fff !important; }
.bg-warning { background-color: var(--bs-warning) !important; color: #000 !important; }
.bg-danger { background-color: var(--bs-danger) !important; color: #fff !important; }
.bg-light { background-color: #f8f9fa !important; color: #212529 !important; }
.bg-dark { background-color: #212529 !important; color: #fff !important; }

/* ============================================
   NAVBAR DROPDOWN FIX (Profile Click Issue)
   Fixes: Profile dropdown not clickable on trips.php and other pages
   Root cause: .main has overflow:hidden in app.css which clips dropdown
   ============================================ */

/* CRITICAL: Override overflow:hidden on .main to allow dropdowns to extend */
.main {
    overflow: visible !important;
}

/* Ensure wrapper doesn't clip navbar dropdowns */
.wrapper {
    overflow: visible !important;
}

.navbar {
    z-index: 1030 !important;
    position: relative;
}

.navbar .dropdown-menu {
    z-index: 1050 !important;
    position: absolute !important;
}

.navbar .nav-link.dropdown-toggle,
.navbar .nav-icon.dropdown-toggle {
    cursor: pointer !important;
    position: relative;
    z-index: 1031;
    pointer-events: auto !important;
}

/* Ensure dropdown trigger is fully clickable */
.navbar-nav .nav-item.dropdown {
    position: relative;
    z-index: 1032;
}

/* Ensure dropdown is clickable on all pages */
.navbar-nav .dropdown {
    position: relative;
}

.navbar-nav .dropdown-toggle::after {
    display: inline-block;
}

/* Ensure dropdown menu appears above all content */
.navbar-nav .dropdown-menu.show {
    z-index: 1055 !important;
    display: block !important;
}

/* Fix any potential overlay issues from content sections */
.content,
main.content,
.container-fluid {
    position: relative;
    z-index: 1;
}

/* Ensure navbar collapse doesn't block clicks */
.navbar-collapse {
    z-index: 1030;
}

/* ============================================
   MOBILE RESPONSIVENESS FIXES
   ============================================ */

/* Fixed/Sticky Header on Mobile */
@media (max-width: 991.98px) {
    /* Make navbar sticky on mobile */
    .navbar {
        position: sticky !important;
        top: 0;
        z-index: 1030;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Ensure main content doesn't clip navbar dropdowns */
    .main {
        overflow: visible !important;
        overflow-y: auto;
    }
    
    /* Add a mobile header bar with logo when sidebar is collapsed */
    .mobile-brand {
        display: flex;
        align-items: center;
        padding: 0 0.5rem;
    }
    
    .mobile-brand .sidebar-logo {
        width: 32px;
        height: 32px;
        margin-right: 0.5rem;
    }
    
    .mobile-brand .brand-text {
        font-family: var(--tb-font-heading);
        font-weight: 700;
        font-size: 1rem;
        color: var(--tb-primary);
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    /* Show logo and brand on mobile */
    .sidebar-brand {
        display: flex !important;
        padding: 0.75rem 1rem;
    }
    
    .sidebar-logo {
        width: 36px !important;
        height: 36px !important;
    }
    
    .sidebar-brand .brand-text {
        display: block !important;
        font-size: 0.9rem;
    }
    
    /* Mobile navbar adjustments */
    .navbar {
        padding: 0.5rem;
        position: sticky !important;
        top: 0;
        background: #fff !important;
    }
    
    .navbar-nav .nav-link span {
        display: none;
    }
    
    /* Avatar size on mobile */
    .navbar .avatar {
        width: 28px !important;
        height: 28px !important;
    }
    
    /* Ensure sidebar toggle is visible */
    .sidebar-toggle {
        display: flex !important;
        align-items: center;
        padding: 0.5rem;
    }
    
    /* Collapsed sidebar - show brand in mobile header */
    .sidebar.collapsed .sidebar-brand {
        display: none;
    }
    
    /* Mobile trip cards */
    .trip-card {
        margin-bottom: 1rem;
    }
    
    .trip-card-image {
        height: 150px;
    }
    
    /* Mobile content padding for sticky header */
    .content {
        padding-top: 1rem;
    }
}

/* Ensure mobile sidebar has proper z-index and visibility */
@media (max-width: 991.98px) {
    .sidebar {
        z-index: 1050 !important;
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        /* AdminKit uses margin-left for mobile sidebar toggle */
        /* When NOT collapsed (default): margin-left: -260px (hidden) */
        /* When collapsed class added: margin-left: 0 (shown) */
    }
    
    /* Ensure sidebar content is always visible when sidebar is shown */
    .sidebar .sidebar-content,
    .sidebar .sidebar-nav,
    .sidebar .sidebar-nav .sidebar-item,
    .sidebar .sidebar-nav .sidebar-link {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Add smooth transition for sidebar */
    .sidebar {
        transition: margin-left 0.35s ease-in-out !important;
    }
    
    /* When sidebar is visible (collapsed class on mobile = visible) */
    .sidebar.collapsed {
        margin-left: 0 !important;
    }
    
    /* Ensure text shows immediately */
    .sidebar.collapsed .sidebar-nav,
    .sidebar.collapsed .sidebar-content {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Mobile sidebar backdrop overlay */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1045;
        opacity: 0;
        transition: opacity 0.35s ease-in-out;
    }
    
    .sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }
    
    /* Mobile close button inside sidebar */
    .sidebar-close {
        display: block !important;
        position: absolute;
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 50%;
        color: #fff;
        font-size: 1.2rem;
        cursor: pointer;
        z-index: 1060;
        line-height: 32px;
        text-align: center;
    }
    
    .sidebar-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* Hide mobile close button on desktop */
@media (min-width: 992px) {
    .sidebar-close {
        display: none !important;
    }
    .sidebar-backdrop {
        display: none !important;
    }
}

/* ============================================
   ECO-CONSCIOUS SIDEBAR CARD FIX
   ============================================ */
.sidebar-cta {
    margin: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(42, 157, 143, 0.15) 0%, rgba(38, 70, 83, 0.1) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-cta-content {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.sidebar-cta-content .d-flex {
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-cta-content i.bi-brightness-high {
    color: #E9C46A;
    font-size: 1.1rem;
}

.sidebar-cta-content strong {
    color: #8AB17D !important;
    font-size: 0.95rem;
}

.sidebar-cta-content .mb-3 {
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0.85;
}

.sidebar-cta .btn-cta {
    background: linear-gradient(135deg, var(--tb-secondary) 0%, #238b7e 100%);
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sidebar-cta .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.4);
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
[data-theme="dark"],
.dark-mode {
    --tb-body-bg: #1a1d21;
    --tb-body-color: #e9ecef;
    --tb-card-bg: #212529;
    --tb-border-color: #343a40;
}

[data-theme="dark"] body,
.dark-mode body {
    background-color: var(--tb-body-bg);
    color: var(--tb-body-color);
}

[data-theme="dark"] .card,
.dark-mode .card {
    background-color: var(--tb-card-bg);
    border-color: var(--tb-border-color);
}

[data-theme="dark"] .navbar-bg,
.dark-mode .navbar-bg {
    background-color: var(--tb-card-bg);
    border-bottom: 1px solid var(--tb-border-color);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
.dark-mode .form-control,
.dark-mode .form-select {
    background-color: #2d3238;
    border-color: var(--tb-border-color);
    color: var(--tb-body-color);
}

[data-theme="dark"] .dropdown-menu,
.dark-mode .dropdown-menu {
    background-color: #2d3238;
    border-color: var(--tb-border-color);
}

[data-theme="dark"] .dropdown-item,
.dark-mode .dropdown-item {
    color: var(--tb-body-color);
}

[data-theme="dark"] .dropdown-item:hover,
.dark-mode .dropdown-item:hover {
    background-color: #343a40;
}

[data-theme="dark"] .table,
.dark-mode .table {
    color: var(--tb-body-color);
}

[data-theme="dark"] .table > :not(caption) > * > *,
.dark-mode .table > :not(caption) > * > * {
    background-color: transparent;
    border-color: var(--tb-border-color);
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, 
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6,
.dark-mode h1, .dark-mode h2, .dark-mode h3,
.dark-mode h4, .dark-mode h5, .dark-mode h6 {
    color: #f8f9fa;
}

[data-theme="dark"] .text-muted,
.dark-mode .text-muted {
    color: #adb5bd !important;
}

/* Dark mode mobile brand */
[data-theme="dark"] .mobile-brand .brand-text,
.dark-mode .mobile-brand .brand-text {
    color: #f8f9fa;
}

/* Dark mode sticky navbar on mobile */
@media (max-width: 991.98px) {
    [data-theme="dark"] .navbar,
    .dark-mode .navbar {
        background: var(--tb-card-bg) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}



/* ============================================
   MODERN ALERTS & NOTIFICATIONS
   ============================================ */
.alert {
    border: none;
    border-left: 4px solid transparent;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--tb-body-color);
}

.alert .btn-close {
    margin-left: auto;
    padding: 1.25rem;
    top: 0;
    right: 0;
    position: absolute;
}

.alert-success {
    border-left-color: var(--tb-success);
}
.alert-success::before {
    content: "\F26B"; /* bi-check-circle-fill */
    font-family: "bootstrap-icons";
    color: var(--tb-success);
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 2px;
}

.alert-danger {
    border-left-color: var(--tb-danger);
}
.alert-danger::before {
    content: "\F333"; /* bi-exclamation-circle-fill */
    font-family: "bootstrap-icons";
    color: var(--tb-danger);
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 2px;
}

.alert-warning {
    border-left-color: var(--tb-warning);
}
.alert-warning::before {
    content: "\F33A"; /* bi-exclamation-triangle-fill */
    font-family: "bootstrap-icons";
    color: var(--tb-warning);
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 2px;
}

.alert-info {
    border-left-color: var(--tb-info);
}
.alert-info::before {
    content: "\F431"; /* bi-info-circle-fill */
    font-family: "bootstrap-icons";
    color: var(--tb-info);
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 2px;
}

/* Remove default icons if they exist in HTML to avoid double icons */
.alert .bi {
    display: none;
}

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

/* Toast Container for Alerts */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 350px;
    max-width: 90vw;
    pointer-events: none;
}

.alert-container .alert {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* ============================================
   SPEND TRACKER STYLES
   ============================================ */

/* Trip Selector Card */
.trip-select-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.trip-select-card:hover {
    transform: translateY(-4px);
    border-color: var(--tb-secondary);
    box-shadow: 0 8px 25px rgba(42, 157, 143, 0.15);
}

.trip-select-card .card-body {
    color: var(--tb-body-color);
}

.trip-select-card:hover .card-title {
    color: var(--tb-secondary);
}

/* Spend Summary Cards */
.spend-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.spend-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.spend-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.spend-amount {
    font-family: var(--tb-font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--tb-primary);
}

@media (max-width: 768px) {
    .spend-amount {
        font-size: 1.2rem;
    }
    
    .spend-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* Transaction List */
.transaction-list {
    max-height: 600px;
    overflow-y: auto;
}

.transaction-date-header {
    padding: 0.5rem 1rem;
    background: var(--tb-body-bg);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    position: sticky;
    top: 0;
    z-index: 5;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.transaction-item:hover {
    background-color: rgba(42, 157, 143, 0.05);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.transaction-details {
    flex: 1;
    min-width: 0;
    margin-left: 0.75rem;
}

.transaction-title {
    font-weight: 600;
    color: var(--tb-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-meta {
    margin-top: 0.25rem;
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.transaction-meta .badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.2rem 0.4rem;
}

.transaction-amount {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    margin-left: 1rem;
}

/* Transaction type variants */
.transaction-advance {
    background-color: rgba(42, 157, 143, 0.03);
}

.transaction-expense {
    background-color: transparent;
}

/* Settlement List */
.settlement-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settlement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--tb-body-bg);
    border-radius: 8px;
}

/* Balance indicators */
.balance-positive {
    color: var(--tb-success) !important;
}

.balance-negative {
    color: var(--tb-danger) !important;
}

.balance-zero {
    color: #6c757d !important;
}

/* Category Progress Bars */
.list-group-item .progress {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

/* Filter Buttons */
.btn-group-sm .btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Expense Modals */
#addExpenseModal .form-label,
#addAdvanceModal .form-label {
    font-weight: 600;
    color: var(--tb-primary);
}

#addExpenseModal .form-check-label,
#addAdvanceModal .form-check-label {
    font-weight: 400;
}

/* Member Balance List */
.list-group-item.bg-primary-subtle {
    background-color: rgba(38, 70, 83, 0.1) !important;
}

/* Responsive adjustments for spend tracker */
@media (max-width: 576px) {
    .transaction-item {
        padding: 0.75rem;
    }
    
    .transaction-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .transaction-amount {
        font-size: 0.9rem;
    }
    
    .spend-card .card-body {
        padding: 0.875rem;
    }
    
    .settlement-item {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Empty State */
.transaction-list .text-center {
    padding: 3rem 1rem;
}

.transaction-list .display-4 {
    color: #d1d5db;
}

/* Animation for new transactions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transaction-item {
    animation: fadeInUp 0.3s ease-out;
}

/* Sync Button Animation */
.btn-outline-secondary .bi-arrow-repeat {
    transition: transform 0.3s ease;
}

.btn-outline-secondary:hover .bi-arrow-repeat {
    transform: rotate(180deg);
}

/* ============================================
   INTERACTIVE FORMS - Modern Form UI
   ============================================ */

/* Form Header Card */
.form-header-card {
    background: linear-gradient(135deg, #ffffff 0%, #edf7f6 50%, #e8f4f2 100%);
    overflow: hidden;
    position: relative;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px rgba(42, 157, 143, 0.10);
}

.form-header-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(42, 157, 143, 0.08);
}

.form-header-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(38, 70, 83, 0.05);
}

.form-icon-wrapper {
    --fi-color: #2A9D8F;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(42, 157, 143, 0.12);
    color: #2A9D8F;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.form-header-card:hover .form-icon-wrapper {
    transform: scale(1.05);
}

.form-icon-wrapper.form-icon-lg {
    width: 68px;
    height: 68px;
    font-size: 2rem;
}

.form-meta-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    color: #6b7280;
    background: rgba(0,0,0,0.04);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 500;
}

.form-meta-badge.badge-expired {
    background: rgba(220,53,69,0.10);
    color: #dc3545;
}

.form-meta-badge.badge-success {
    background: rgba(42,157,143,0.10);
    color: #2A9D8F;
}

/* Progress Bar - more visible */
.form-progress-wrapper {
    height: 6px;
    background: rgba(0,0,0,0.06);
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}

.form-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2A9D8F, #38b2ac, #4fd1c5);
    border-radius: 0 3px 3px 0;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.form-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Form Field Cards */
.form-field-card {
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    animation: formFieldSlideIn 0.4s ease-out backwards;
    border-left: 4px solid #e5e7eb !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    border-left: 4px solid #e5e7eb !important;
}

.form-field-card:nth-child(1)  { animation-delay: 0.04s; }
.form-field-card:nth-child(2)  { animation-delay: 0.08s; }
.form-field-card:nth-child(3)  { animation-delay: 0.12s; }
.form-field-card:nth-child(4)  { animation-delay: 0.16s; }
.form-field-card:nth-child(5)  { animation-delay: 0.20s; }
.form-field-card:nth-child(6)  { animation-delay: 0.24s; }
.form-field-card:nth-child(7)  { animation-delay: 0.28s; }
.form-field-card:nth-child(8)  { animation-delay: 0.32s; }
.form-field-card:nth-child(9)  { animation-delay: 0.36s; }
.form-field-card:nth-child(10) { animation-delay: 0.40s; }

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

.form-field-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.form-field-card:focus-within {
    border-left-color: #2A9D8F !important;
    box-shadow: 0 6px 24px rgba(42, 157, 143, 0.14);
    transform: translateY(-2px);
}

.form-field-card.field-completed {
    border-left-color: #28a745 !important;
    background: linear-gradient(to right, rgba(40, 167, 69, 0.02), transparent) !important;
}

.form-field-card.field-invalid {
    border-left-color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.02) !important;
    animation: fieldShake 0.4s ease;
}

@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Field number pill */
.form-field-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #264653, #2A6F65);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(38, 70, 83, 0.2);
}

.form-field-card.field-completed .form-field-number {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.25);
}

.form-field-card:focus-within .form-field-number {
    background: linear-gradient(135deg, #2A9D8F, #38b2ac);
    transform: scale(1.1);
}

.form-field-type-icon {
    color: #c9cdd3;
    font-size: 1.1rem;
}

/* Radio & Checkbox Option Cards */
.form-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.form-option-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.form-option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(42, 157, 143, 0.06), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.form-option-card:hover {
    border-color: #2A9D8F;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.10);
}

.form-option-card:hover::before {
    opacity: 1;
}

.form-option-card.selected,
.form-option-card:has(:checked) {
    border-color: #2A9D8F;
    background: rgba(42, 157, 143, 0.06);
    box-shadow: 0 2px 12px rgba(42, 157, 143, 0.12);
}

.form-option-card .form-check-input {
    margin: 0;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
}

.form-option-card .form-check-input:checked {
    background-color: #2A9D8F;
    border-color: #2A9D8F;
}

.form-option-label {
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* File Upload Zone */
.file-upload-zone {
    position: relative;
    border: 2px dashed #c9cdd3;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fafbfc, #f5f7f9);
    cursor: pointer;
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: #2A9D8F;
    background: linear-gradient(135deg, rgba(42, 157, 143, 0.04), rgba(42, 157, 143, 0.02));
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(42, 157, 143, 0.10);
}

.file-upload-zone .field-file {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content {
    pointer-events: none;
}

.file-upload-zone.file-selected {
    border-color: #28a745;
    border-style: solid;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.04), rgba(40, 167, 69, 0.02));
}

/* Submit Card */
.form-submit-card {
    position: sticky;
    bottom: 1rem;
    z-index: 10;
    background: #ffffff !important;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.10);
    border-radius: 16px !important;
    border: 1px solid rgba(42, 157, 143, 0.12) !important;
}

/* Enhanced Form Controls */
.form-field-card .form-control,
.form-field-card .form-select {
    border-radius: 10px;
    border: 1.5px solid #e0e3e8;
    transition: all 0.2s ease;
}

.form-field-card .form-control:focus,
.form-field-card .form-select:focus {
    border-color: #2A9D8F;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.15);
}

.form-field-card .form-control-lg {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

.form-field-card .input-group-text {
    background: #f8fafb;
    border-color: #e0e3e8;
    color: #2A9D8F;
    border-radius: 10px 0 0 10px;
}

/* ============================================
   SIDEBAR ENHANCEMENTS - Collapsible with Icons
   ============================================ */

/* Desktop-only icon-only collapse (sidebar-mini class).
   AdminKit uses 'collapsed' for mobile show/hide (margin-left toggle).
   AdminKit sets min-width:260px; max-width:260px on .sidebar — we must
   override both with !important so the flex child actually shrinks.
   The .wrapper is display:flex so .main auto-expands when sidebar shrinks. */
@media (min-width: 992px) {
    .sidebar {
        transition: min-width 0.25s ease, max-width 0.25s ease;
    }

    .sidebar.sidebar-mini {
        min-width: 70px !important;
        max-width: 70px !important;
        overflow: hidden;
    }

    /* Hide text labels, section headers, CTA, submenu labels/arrows */
    .sidebar.sidebar-mini .sidebar-brand .brand-text,
    .sidebar.sidebar-mini .sidebar-header,
    .sidebar.sidebar-mini .sidebar-link span,
    .sidebar.sidebar-mini .sidebar-cta,
    .sidebar.sidebar-mini .sidebar-submenu-label,
    .sidebar.sidebar-mini .sidebar-submenu-arrow {
        display: none;
    }

    /* Center the logo */
    .sidebar.sidebar-mini .sidebar-brand {
        padding: 1.15rem 0;
        justify-content: center;
    }

    /* Center the nav icons */
    .sidebar.sidebar-mini .sidebar-link {
        padding: 0.75rem 0;
        justify-content: center;
        text-align: center;
        border-left-color: transparent !important;
    }

    .sidebar.sidebar-mini .sidebar-link i,
    .sidebar.sidebar-mini .sidebar-link svg {
        margin-right: 0;
        font-size: 1.25rem;
    }

    /* Hide submenus in collapsed state */
    .sidebar.sidebar-mini .sidebar-submenu {
        display: none !important;
    }

    /* Hover-to-expand: sidebar widens on hover to reveal labels */
    .sidebar.sidebar-mini:hover {
        min-width: 260px !important;
        max-width: 260px !important;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
        z-index: 1050;
    }

    /* When hovering, restore all hidden elements */
    .sidebar.sidebar-mini:hover .sidebar-brand .brand-text,
    .sidebar.sidebar-mini:hover .sidebar-header,
    .sidebar.sidebar-mini:hover .sidebar-link span,
    .sidebar.sidebar-mini:hover .sidebar-cta,
    .sidebar.sidebar-mini:hover .sidebar-submenu-label,
    .sidebar.sidebar-mini:hover .sidebar-submenu-arrow {
        display: unset;
    }

    .sidebar.sidebar-mini:hover .sidebar-brand {
        padding: 1.15rem 1.5rem;
    }

    .sidebar.sidebar-mini:hover .sidebar-link {
        padding: 0.625rem 1.5rem;
        justify-content: flex-start;
        text-align: left;
    }

    .sidebar.sidebar-mini:hover .sidebar-link i,
    .sidebar.sidebar-mini:hover .sidebar-link svg {
        margin-right: 0.75rem;
        font-size: inherit;
    }

    .sidebar.sidebar-mini:hover .sidebar-submenu {
        display: block !important;
    }

    /* Sidebar toggle button (desktop only) */
    .sidebar-toggle-btn {
        position: absolute;
        top: 50%;
        right: -14px;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #264653;
        color: #fff;
        border: 2px solid #F4F1DE;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1051;
        font-size: 0.7rem;
        transition: all 0.2s ease;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        opacity: 0;
    }

    .sidebar:hover .sidebar-toggle-btn,
    .sidebar.sidebar-mini .sidebar-toggle-btn {
        opacity: 1;
    }

    .sidebar.sidebar-mini .sidebar-toggle-btn i {
        transform: rotate(180deg);
    }
}

/* Hide toggle button on mobile (hamburger handles it) */
@media (max-width: 991.98px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
}

/* Sidebar Submenu Support */
.sidebar-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.sidebar-submenu-toggle .sidebar-submenu-arrow {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
}

.sidebar-submenu-toggle[aria-expanded="true"] .sidebar-submenu-arrow {
    transform: rotate(90deg);
}

.sidebar-submenu {
    padding-left: 0;
    list-style: none;
}

.sidebar-submenu .sidebar-link {
    padding-left: 3rem;
    font-size: 0.88rem;
}

/* ============================================
   FOOTER IMPROVEMENTS
   ============================================ */
.footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 0;
}

.footer .list-inline {
    margin-bottom: 0;
}

.footer .list-inline-item a {
    transition: color 0.2s ease;
}

.footer .list-inline-item a:hover {
    color: var(--tb-secondary) !important;
}

/* ============================================
   PARALLAX HERO SECTIONS
   ============================================ */
.parallax-hero {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parallax-hero-bg {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: brightness(0.6);
    z-index: 0;
}

.parallax-hero-content {
    position: relative;
    z-index: 1;
    color: #fff;
    text-align: center;
}

/* ============================================
   SMOOTH PAGE TRANSITIONS
   ============================================ */
.content {
    animation: pageContentFade 0.3s ease-out;
}

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

/* ============================================
   RESPONSIVE FOOTER FIX
   ============================================ */
@media (max-width: 767.98px) {
    .footer .row {
        flex-direction: column;
        text-align: center;
    }
    .footer .col-6 {
        width: 100%;
    }
    .footer .col-6.text-end {
        text-align: center !important;
        margin-top: 0.5rem;
    }
    .footer .list-inline-item {
        margin-bottom: 0.25rem;
    }
    
    /* Form responsive */
    .form-options-grid {
        grid-template-columns: 1fr;
    }
    .form-submit-card {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        border-bottom: none !important;
        background: #ffffff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding-bottom: env(safe-area-inset-bottom, 12px);
        z-index: 1050;
    }
    .form-header-card {
        border-radius: 12px !important;
    }
    .form-field-card {
        border-radius: 10px !important;
    }
    /* Add bottom padding so fixed bar doesn't cover last field or footer */
    #tripFormResponse {
        padding-bottom: calc(110px + env(safe-area-inset-bottom, 12px));
    }
}

/* ============================================
   PAGINATION (Bootstrap .pagination is missing from the AdminKit build, so
   pagers rendered as raw vertical bullet lists — restore a proper horizontal,
   brand-styled control used everywhere: tb-paginate tables, sub-team member
   assignment, booking dashboard, etc.)
   ============================================ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding-left: 0;
    margin: 0;
    list-style: none;
}
.pagination .page-item {
    list-style: none;
    margin: 0;
}
.pagination .page-item + .page-item {
    margin-left: 4px;
}
.pagination .page-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    color: var(--tb-primary, #264653);
    background-color: #fff;
    border: 1px solid var(--tb-border, #dde3e6);
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.pagination .page-link:hover {
    background-color: var(--tb-primary-50, #e9f0f1);
    border-color: var(--tb-secondary, #2A9D8F);
    color: var(--tb-primary, #264653);
}
.pagination .page-item.active .page-link {
    z-index: 2;
    color: #fff;
    background-color: var(--tb-secondary, #2A9D8F);
    border-color: var(--tb-secondary, #2A9D8F);
    font-weight: 600;
}
.pagination .page-item.disabled .page-link {
    color: var(--tb-text-muted, #98a1a6);
    pointer-events: none;
    opacity: 0.55;
}
/* Small variant */
.pagination-sm .page-link {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    font-size: 0.8125rem;
    border-radius: 7px;
}


