/* =========================================
   style.css
   Modern rounded UI + OneStop + Booking + House Selection
   Tables: bookings + houses visually identical (summary-table look)
   Fix: centered columns for Available Houses + My Bookings (desktop/tablet)
   ========================================= */

/* 0) Global box sizing */
*,
*::before,
*::after { box-sizing: border-box; }

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

/* 1) Design tokens */
:root{
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: rgba(17, 24, 39, 0.10);
  --focus: 0 0 0 4px rgba(37, 99, 235, 0.22);
  --shadow-card: 0 12px 30px rgba(17, 24, 39, 0.08);
  --shadow-soft: 0 2px 10px rgba(17, 24, 39, 0.06);
  --shadow-pressed: 0 1px 2px rgba(17, 24, 39, 0.08);
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #6b7280;
  --secondary-hover: #4b5563;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --input-bg: #ffffff;
  --input-border: rgba(17, 24, 39, 0.16);
  --chip-bg: rgba(37, 99, 235, 0.10);
}

/* ============== Base layout ============== */
body{
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.container{
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem;
}

.block{
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255,255,255,0.7);
}

.text-center{ 
  text-align: center; 
} 

h2{
  font-size: 1.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  padding-bottom: 0.75rem;
  letter-spacing: 0.2px;
}

/* ============== Forms ============== */
.form-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem; /* Creates space between form fields */
  flex-wrap: wrap; /* Allows fields to stack in smaller screens */
  justify-content: space-between; /* This ensures the fields stretch across the row */
  width: 100%;
}

.form-group{
  display: flex;
  flex: 1 1 23%;
  flex-direction: column;
  max-width: 100%; /* Ensure it doesn’t overflow */
}

.form-group.full-width {
  flex: 1 1 100%; /* Ensures full width on small screens */
}

.form-row .form-group {
  flex: 1 1 23%; /* Take equal space for 4 items in a row */
}

.form-grid .form-group {
  flex: 1;
}

.form-actions {
  text-align: right;
  margin-top: 1rem;
}

.form-actions .btn-primary {
  padding: 0.8rem 1.6rem;
  border-radius: 25px;
  background-color: #1d4ed8; /* blue */
  color: white;
  border: none;
  cursor: pointer;
}

.form-actions .btn-primary:hover {
  background-color: #2563eb;
}

.full-width { 
  flex: 1 1 100%; 
}

.half-width {
  flex: 1 1 48%; /* For two items in one row with some gap */
}

label{
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-xs);
  background-color: var(--input-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

input:focus, select:focus{
  outline: none;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: var(--focus);
}

input:focus:not(:focus-visible),
select:focus:not(:focus-visible){
  box-shadow: none;
  border-color: var(--input-border);
}

input:hover, select:hover{
  border-color: rgba(17, 24, 39, 0.24);
}

/* Date inputs */
input[type="date"] {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-xs);
  background-color: var(--input-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Auto set Check-out date +1 day from Check-in */
#checkin {
  min-width: 150px;
}

#checkout {
  min-width: 150px;
}

input[type="date"]:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: var(--focus);
}

select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

textarea{
  width: 100%;
  min-height: 100px;
  padding: 0.7rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-xs);
  background-color: var(--input-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus{
  outline: none;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: var(--focus);
}

textarea:focus:not(:focus-visible){
  box-shadow: none;
  border-color: var(--input-border);
}

.helper-text{
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* ============== Buttons ============== */
.btn-primary,
.btn-primary:active,
.btn-primary:focus,
.btn-primary:focus:not(:focus-visible),
.btn-primary:disabled,

.btn-primary{
  background-color: var(--primary);
  color: #fff;
}

.btn-primary:hover{
  background-color: var(--primary-hover);
  filter: brightness(1.02);
}

.btn-secondary,
.btn-secondary:active,
.btn-secondary:focus:not(:focus-visible),
.btn-secondary:focus,
.btn-secondary:disabled,

.btn-secondary{
  background: #eef2ff;
  background-color: var(--secondary);
  border: 1px solid transparent;
  border-color: rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  color: #1f2937;
  min-height: 44px;
  padding: 0.6rem 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
  background-color: #e0e7ff;
}

.btn-secondary:disabled{
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-danger{
  background-color: var(--danger);
  color: #7f1d1d;
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  border: 1px solid rgba(239, 68, 68, 0.20);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.06s ease, background-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-danger:disabled{
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.1);
}

.btn-danger:focus{
  outline: none;
  box-shadow: var(--focus);
}

.btn-danger:focus:not(:focus-visible){
  box-shadow: var(--shadow-soft);
}

.btn-danger:active{
  transform: translateY(1px);
  box-shadow: var(--shadow-pressed);
}

.btn-danger:hover {
  background-color: #fecaca;
}

/* keep default box length */
.btn-animated{
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.2px;
  cursor: pointer;
  width: min(100%, 14rem);
  min-height: 48px;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  box-shadow: var(--shadow-soft);
  text-align: left;
  background: #fff;
  transition: transform 0.08s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-animated:hover{ 
  transform: translateY(-2px); 
  box-shadow: 0 14px 28px rgba(17,24,39,.10);
  filter: brightness(1.01);
}

.btn-animated:active{ 
  transform: translateY(0); 
  box-shadow: var(--shadow-pressed); 
}

.btn-animated:focus{ 
  outline:none; 
  box-shadow: var(--focus); 
}

.btn-animated:focus-visible{
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.28);
}

.btn-animated:disabled{ 
  opacity: 0.65; 
  cursor: not-allowed; 
}

.btn-title{ 
  display:block; 
  font-size:1.05rem; 
  font-weight:900; 
}

.auth-link-btn{ 
  text-decoration:none; 
}

/* ============== Flash messages ============== */

.flash-messages{
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.alert{
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(17, 24, 39, 0.10);
  box-shadow: var(--shadow-soft);
  background: #fff;
  font-weight: 600;
}

.alert-success{
  background: #dcfce7;
  border-color: rgba(34, 197, 94, 0.28);
  color: #14532d;
}

.alert-error{
  background: #fee2e2;
  border-color: rgba(239, 68, 68, 0.30);
  color: #7f1d1d;
}

/* Error box (stronger) */
.error-box{
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.30);
  background: #fee2e2;
  color: #7f1d1d;
  margin: .75rem 0;
  box-shadow: var(--shadow-soft);
}

.error-box h3{
  margin: 0 0 .35rem 0;
  font-size: 1rem;
  font-weight: 900;
}

.error-list{
  margin: 0;
  padding-left: 1.1rem;
}

/* Screen-reader only */

.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============== Booking header (booking.html) ============== */

.booking-header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
}

.booking-title{
  display:flex;
  align-items:center;
  gap:1rem;
}

.booking-badge{
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  border-radius:16px;
  background: rgba(37,99,235,0.10);
  border: 1px solid rgba(37,99,235,0.14);
  box-shadow: var(--shadow-soft);
  font-size: 1.4rem;
}

.booking-subtitle{
  margin:0;
  color: var(--muted);
}

/* ============== House Selection UI ============== */

.page-shell{ width:100%; max-width:980px; }

.page-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
  margin-bottom:.9rem;
}

.page-title-row h2{
  margin:0;
  border:none;
  padding:0;
}

.page-subtitle{
  margin:.25rem 0 0;
  color: var(--muted);
  font-size:.95rem;
}

.right-actions{
  display:flex;
  gap:.6rem;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

.block + .block{ margin-top: 1.25rem; }

.block-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
  margin-bottom:.75rem;
  padding-bottom:.55rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.block-title{
  display:flex;
  align-items:center;
  gap:.65rem;
  margin:0;
  font-size:1.05rem;
  font-weight:900;
  letter-spacing:.2px;
}

.note{
  margin:.25rem 0 0;
  color: var(--muted);
  font-size:.9rem;
}

.icon-badge{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: rgba(37, 99, 235, 0.10);
  color: #1e3a8a;
  font-size: 1.05rem;
  flex: 0 0 auto;
}

.icon-badge.bookings{
  background: rgba(34, 197, 94, 0.12);
  color: #14532d;
  border-color: rgba(34, 197, 94, 0.20);
}

/* Filters */

.filters{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: .75rem 0 0.25rem;
}

.filters .filter-item label{
  font-size: .85rem;
  margin-bottom: .25rem;
}

.filters .filter-item input{ min-height: 42px; }

.filters-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: .75rem;
  flex-wrap:wrap;
  margin-top: .5rem;
  margin-bottom: .25rem;
}

.count-pill{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.25rem .6rem;
  border-radius:999px;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #1f2937;
  font-weight: 800;
  font-size: .85rem;
}

/* ============== TABLE SYSTEM (summary-table look) ============== */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;              /* keeps it responsive if content is wide */
  -webkit-overflow-scrolling: touch;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-top: 20px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse; /* changed to collapse for cleaner look */
  margin-top: .25rem;
  font-size: 1rem; /* increased font size */
  text-align: center;
}

/* Header */

.data-table thead th {
  background: #f1f1f1; /* added a light background color */
  border: none;
  color: var(--muted);
  font-weight: 700; /* reduced font weight for better readability */
  padding: 0.5rem 0.75rem;
  text-align: center; /* centered the text for consistency */
}

/* Cells */

.data-table tbody td {
  padding: 1rem 0.75rem; /* increased padding for better readability */
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  background: #fff;
  vertical-align: middle;
  word-wrap: break-word; /* prevents overflow for long words */
  text-align: center;
}

.data-table th, .data-table td {
  text-align: center; /* Default center alignment */
}

.data-table th:first-child, .data-table td:first-child {
  text-align: left; /* Left-align the first column (Guest Name) */
}

/* Optional: Adjust padding for better visual alignment */
.data-table th, .data-table td {
  padding: 1rem;
}

/* Rounded row edges */

.data-table tbody tr td:first-child {
  border-left: 1px solid rgba(17, 24, 39, 0.08);
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
  text-align: left;
}

.data-table tbody tr td:last-child {
  border-right: 1px solid rgba(17, 24, 39, 0.08);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

/* Action buttons in table */

.table-action a, .table-action span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px; /* increased height for better touch targets */
  padding: .75rem 1rem; /* increased padding */
  border-radius: 999px;
  font-weight: 700; /* reduced font weight */
  text-decoration: none;
  cursor: pointer;
}

.table-action a:hover, .table-action button:hover {
  text-decoration: underline;
}

/* Style for Approve and Reject icons */

.approve-icon, .reject-icon {
  background: none;
  border: none;
  font-size: 1.5rem;  /* Adjust size if necessary */
  cursor: pointer;
  margin-right: 12px; /* Space between the two buttons */
  padding: 0.5rem 0.75rem; /* Add some padding around the icon */
  border-radius: 5px; /* Optional: Rounded corners */
  line-height: 1; /* Ensures proper vertical alignment of icons */
}

/* Approve icon color */

.approve-icon {
  color: green;
}

/* Reject icon color */

.reject-icon {
  color: red;
}

/* Hover effect for both icons */

.approve-icon:hover, .reject-icon:hover {
  opacity: 0.7;  /* Slight opacity change */
  background-color: rgba(0, 0, 0, 0.1); /* Light background on hover */
  border-radius: 5px;  /* Add rounded corners to the hover effect */
}

/* Optional: Active state (when clicked) */

.approve-icon:active, .reject-icon:active {
  transform: scale(0.98); /* Slight shrink effect when clicked */
}


/* ✅ CENTERING (Desktop/Tablet only) */

@media (min-width: 769px){
  /* Available Houses: center cols 2–5 (City/State/Country/Action) */
  #housesTable th:nth-child(2),
  #housesTable th:nth-child(3),
  #housesTable th:nth-child(4),
  #housesTable th:nth-child(5),
  #housesTable td:nth-child(2),
  #housesTable td:nth-child(3),
  #housesTable td:nth-child(4),
  #housesTable td:nth-child(5){
    text-align: center;
  }

  /* My Bookings: center cols 2–5 (CheckIn/CheckOut/Guests/Status) */
 
  #myBookingsTable th:nth-child(2),
  #myBookingsTable th:nth-child(3),
  #myBookingsTable th:nth-child(4),
  #myBookingsTable th:nth-child(5),
  #myBookingsTable td:nth-child(2),
  #myBookingsTable td:nth-child(3),
  #myBookingsTable td:nth-child(4),
  #myBookingsTable td:nth-child(5){
    text-align: center;
  }

  /* Better centering for buttons inside centered cells */
 
  #housesTable td:nth-child(5) .table-action,
  #housesTable td:nth-child(5),
  #myBookingsTable td:nth-child(5){
    vertical-align: middle;
  }
}

/* Badges */

.badge{
  display:inline-block;
  padding:.25rem .6rem;
  border-radius:999px;
  font-weight:900;
  border:1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
}

.badge-upcoming{
  background:#fff3cd;
  border-color: rgba(255,193,7,.45);
  color:#7c2d12;
}

.badge-paid{
  background:#d1ecf1;
  border-color: rgba(23,162,184,.45);
  color:#0c4a6e;
}

.badge-occupied{
  background:#d4edda;
  border-color: rgba(40,167,69,.45);
  color:#14532d;
}

.badge-completed{
  background:#e2e3e5;
  border-color: rgba(108,117,125,.45);
  color:#374151;
}

/* Mobile/tablet responsiveness */

@media (max-width: 600px) {
  .house-map {
    height: 240px;
    min-height: 300px;
  }
  body {
    font-size: 14px;
  }
  .form-group {
    flex: 1 1 100%;  /* Ensure fields take up full width on small screens */
  }
  .form-grid {
    flex-direction: column;  /* Stacks form fields vertically */
  }
  .half-width {
    flex: 1 1 100%;  /* Ensures fields take up 100% width on small screens */
  }
  .full-width {
    flex: 1 1 100%;  /* Forces full-width on smaller screens */
  }
  .onestop-buttons {
    gap: 1rem;
  }
  .btn-animated {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
}

@media (min-width: 601px) and (max-width: 1024px){
  body{ 
    font-size: 15px; 
  }
  .container{ 
    max-width: 92%; 
  }
  .onestop-buttons{ 
    gap: 1.1rem; 
  }
}

@media (max-width: 900px){
  .onestop-buttons{ 
    grid-template-columns: 1fr; 
  }
  .onestop-brand{ 
    flex-direction: column; 
    text-align: center; 
  }
}

@media (min-width: 1025px){
  body{ 
    font-size: 16px; 
  }
  .container{ 
    max-width: 980px; 
  }
}

/* Small screens: stack action buttons nicely */

@media (max-width: 520px){
  .auth-actions{
    display: grid;
    gap: .6rem;
    flex-direction: column;
    align-items: stretch;
  }
  .auth-actions .btn-primary,
  .auth-actions .btn-secondary,
  .auth-actions .auth-link-btn{
    width: 100%;
    text-align: center;
  }
}

/* Filters on small screens */

@media (max-width: 720px){
  .filters{ 
    grid-template-columns: 1fr; 
  }
  .filters-actions{ 
    justify-content:flex-start; 
  }
}

/* ✅ Mobile card mode for data-table (requires td[data-label]) */

@media (max-width: 768px){
  .table-wrap{ 
    overflow-x: visible; 
  }
  table.data-table thead{ 
    display:none; 
  }
  table.data-table,
  table.data-table tbody,
  table.data-table tr,
  table.data-table td{
    display:block;
    width:100%;
  }
  table.data-table{ 
    border-spacing: 0 10px; 
  }
  table.data-table tr{
    margin-bottom: 1rem;
    border: 1px solid rgba(17, 24, 39, 0.10);
    border-radius: var(--radius);
    padding: 0.25rem;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }
  table.data-table td{
    border: none;
    padding: 0.55rem;
    background: transparent;
    text-align: left;
  }
  table.data-table td[data-label]::before{
    content: attr(data-label);
    font-weight: 800;
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
  }
  .table-action a{
    width: 100%;
    justify-content: center;
  }
  .table-action a,
  .table-action span {
    display: block;
    width: 100%;
    padding: 1rem;
    text-align: center;
  }
  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    padding: 1rem;
  }
}


/* Reduced motion */

@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================
   House Map (Leaflet) — appended (low risk)
   Hardened for mobile viewport quirks
   ========================================= */

.house-map{
  width: 100%;
  height: clamp(320px, 45vh, 520px);
  min-height: 320px;
  border-radius: var(--radius);
  border: 1px solid rgba(17,24,39,0.10);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 768px){
  .form-row {
    flex-direction: column; /* Stack the fields vertically on small screens */
    gap: 1rem;
  }
  .form-group {
    flex: 1 1 100%; /* Ensure fields take up full width on small screens */
  }
  .form-grid {
    flex-direction: column;
  }
  .half-width {
    flex: 1 1 100%; /* Full width for smaller screens */
  }
  .house-map{
    height: 360px;
    min-height: 320px;
  }
}

@media (max-width: 420px){
  .house-map{
    height: 320px;
    min-height: 280px;
  }
}

/* Optional: "Request" as text link (not button) */

.request-link{
  color: var(--primary);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.request-link:hover{
  color: var(--primary-hover);
}

/* Style for the text link */

.text-link {
  background: none;
  border: none;
  color: #007bff;  /* Blue color, adjust as needed */
  text-decoration: none;  /* Remove underline */
  font-size: 14px; /* Adjust font size if needed */
  cursor: pointer;
}

.text-link:hover {
  color: #0056b3;  /* Darker blue for hover effect */
  text-decoration: none;  /* Keep no underline on hover */
}

#houseMap {
    height: 500px;  /* Set height for the map container */
}

/* Fix for Select2 dropdown height */
.select2-container--default .select2-selection--single {
    height: 44px !important; /* Ensure consistent height */
    line-height: 44px !important; /* Align text vertically */
    padding: 0.6rem 0.7rem !important; /* Match padding to other inputs */
    border-radius: var(--radius-xs) !important;
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
}

/* Fix for Select2 dropdown search box */
.select2-container--default .select2-search--dropdown .select2-search__field {
    height: 44px !important; /* Set the same height for the search input inside the dropdown */
    line-height: 44px !important; /* Align text inside the search box */
}

/* Ensure Select2 dropdown width matches the input field */
.select2-container--default .select2-selection--single {
    width: 100% !important;
}

/* Fix for the placeholder text inside the dropdown */
.select2-container--default .select2-selection__rendered {
    padding-left: 0.7rem !important;
    padding-right: 0.7rem !important;
}

/* ============== LOADING ANIMATIONS ============== */

/* Loading spinner animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner.large {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.loading-overlay.active {
  display: flex;
  animation: slideIn 0.3s ease-out;
}

.loading-box {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  min-width: 200px;
}

.loading-box h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--text);
}

.loading-text {
  margin-top: 1rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Pulsing skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 8px;
}

.skeleton.text {
  height: 16px;
  width: 100%;
  margin-bottom: 8px;
}

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

.skeleton.card {
  height: 200px;
  width: 100%;
  margin-bottom: 16px;
}

/* Loading state for buttons */
.btn-primary.loading,
.btn-secondary.loading,
.btn-animated.loading {
  pointer-events: none;
  opacity: 0.8;
  color: transparent;
  position: relative;
}

.btn-primary.loading::after,
.btn-secondary.loading::after,
.btn-animated.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Loading table rows */
.loading-row {
  opacity: 0.6;
  pointer-events: none;
}

.loading-row td {
  padding: 12px;
}

/* Page transition fade */
.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
