/* Main styles for Property Booking Manager */

/* General */
:root {
  --primary-color: #72b9c2;
  --secondary-color: #5ca3ad;
  --success-color: #2D9D78;
  --danger-color: #DA4453;
  --warning-color: #F6BB42;
  --dark-color: #222222;
  --light-color: #F5F7FA;
  --sidebar-width: 200px;
  --border-color: #e0e0e0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f8f8f8;
  color: #333333;
  margin: 0;
  padding: 0;
}

/* Login page styles */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #72b9c2 0%, #8cc7ce 100%);
}

.login-card {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 450px;
  padding: 30px;
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo img {
  max-height: 60px;
  width: auto;
  margin-bottom: 15px;
}

.login-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.login-logo p {
  font-size: 14px;
  color: #7F8C8D;
}

.login-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
}

.login-separator::before,
.login-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #E0E0E0;
}

.login-separator span {
  padding: 0 10px;
  font-size: 14px;
  color: #7F8C8D;
}

.login-demo {
  margin: 20px 0;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
}

.login-footer a {
  color: var(--primary-color);
  text-decoration: none;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  font-size: 14px;
}

.login-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

/* Dashboard Layout */
.layout-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: white;
  color: var(--dark-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.05);
  border-right: 1px solid var(--border-color);
}

.sidebar-logo {
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo img {
  max-height: 35px;
  width: auto;
}

.sidebar-logo i {
  font-size: 20px;
  color: var(--primary-color);
}

.sidebar-logo h1 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-selector {
  padding: 10px 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
  padding: 10px 0;
  flex-grow: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: var(--dark-color);
  text-decoration: none;
  transition: all 0.2s;
  gap: 10px;
  font-size: 14px;
}

.sidebar-nav-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sidebar-nav-item.active {
  font-weight: 600;
  color: var(--primary-color);
  border-left: 3px solid var(--primary-color);
  background-color: rgba(0, 0, 0, 0.03);
}

.sidebar-nav-item i {
  width: 20px;
  text-align: center;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 20px;
  background-color: #f8f8f8;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

/* Stats Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background-color: white;
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.stat-card-title {
  font-size: 14px;
  font-weight: 500;
  color: #666;
  margin: 0;
}

.stat-card-icon {
  color: #555;
}

.stat-card-content h2 {
  font-size: 28px;
  margin: 0 0 5px 0;
  color: var(--dark-color);
  font-weight: 600;
}

.stat-card-content p {
  margin: 5px 0;
  font-weight: 400;
  font-size: 14px;
  color: #666;
}

/* Cards and Tables */
.card {
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 20px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
}

table th {
  background-color: #f8f8f8;
  font-weight: 500;
  color: #666;
  border-bottom: 1px solid var(--border-color);
}

table tr {
  border-bottom: 1px solid var(--border-color);
}

table tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Action Buttons */
.btn-add {
  background-color: var(--dark-color);
  color: white;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-add:hover {
  background-color: #000;
  color: white;
  text-decoration: none;
}

.btn-edit {
  color: var(--dark-color);
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.btn-edit:hover {
  text-decoration: underline;
}

.btn-sync {
  color: var(--primary-color);
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 4px;
  margin-left: 5px;
}

.btn-sync:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: auto;
}

.modal.show {
  display: block;
}

.modal-dialog {
  margin: 30px auto;
  max-width: 600px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Badges */
.badge {
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background-color: var(--success-color);
  color: white;
}

.badge-danger {
  background-color: var(--danger-color);
  color: white;
}

.badge-warning {
  background-color: var(--warning-color);
  color: white;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-confirmed {
  background-color: #e6f7e6;
  color: #2e7d32;
  border: 1px solid #2e7d32;
}

.status-pending {
  background-color: #fff8e1;
  color: #f57c00;
  border: 1px solid #f57c00;
}

.status-cancelled {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #c62828;
}

/* Booking details */
.booking-detail {
  padding: 10px;
}

.booking-detail-row {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.booking-detail-label {
  width: 30%;
  font-weight: 600;
  color: #555;
}

.booking-detail-value {
  width: 70%;
}

.btn-view {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 4px;
  background-color: #fff !important;
  border: 1px solid #3b82f6 !important;
  color: #3b82f6 !important;
  text-decoration: none;
  font-size: 12px;
  margin-left: 5px;
  cursor: pointer;
}

.btn-view:hover {
  background-color: #3b82f6 !important;
  color: white !important;
}

/* Buttons */
.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 4px;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background-color: var(--secondary-color);
}

.btn-secondary {
  background-color: var(--dark-color);
  color: white;
}

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

.btn-outline-secondary {
  border: 1px solid #E0E0E0;
  background-color: transparent;
  color: #7F8C8D;
}

.btn-outline-secondary:hover {
  background-color: #F5F7FA;
  color: var(--dark-color);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Flash messages */
.flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 350px;
}

.alert {
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.alert-success {
  background-color: var(--success-color);
  color: white;
}

.alert-danger {
  background-color: var(--danger-color);
  color: white;
}

.alert-info {
  background-color: var(--primary-color);
  color: white;
}

/* Forms */
form {
  margin-bottom: 20px;
}

.form-check-label {
  margin-left: 5px;
}

/* Service availability styles */
.service-disabled {
  opacity: 0.5 !important;
  pointer-events: none !important;
  background-color: #f8f9fa !important;
}

.service-disabled input[type="checkbox"] {
  cursor: not-allowed;
}

.service-disabled .service-name {
  color: #6c757d !important;
  text-decoration: line-through;
}

.service-availability-note {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
}

/* Improved form styling */
.form-control {
  padding: 0.75rem 1rem !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.5rem !important;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.form-control:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(114, 185, 194, 0.25) !important;
  outline: 0 !important;
}

.form-label {
  font-weight: 500 !important;
  color: #374151 !important;
  margin-bottom: 0.5rem !important;
  font-size: 0.875rem !important;
}

/* Modal improvements */
.modal-content {
  border-radius: 1rem !important;
  border: none !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.modal-header {
  border-bottom: 1px solid #f3f4f6 !important;
  padding: 1.5rem 1.5rem 1rem 1.5rem !important;
}

.modal-body {
  padding: 1.5rem !important;
}

.modal-footer {
  border-top: 1px solid #f3f4f6 !important;
  padding: 1rem 1.5rem 1.5rem 1.5rem !important;
}

/* Card improvements */
.card {
  border-radius: 1rem !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.card-header {
  background-color: #f9fafb !important;
  border-bottom: 1px solid #e5e7eb !important;
  border-radius: 1rem 1rem 0 0 !important;
  padding: 1.5rem !important;
}

.card-body {
  padding: 1.5rem !important;
}

/* Service item styling */
.service-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease-in-out;
  background-color: #ffffff;
}

.service-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(114, 185, 194, 0.15);
}

.service-item input[type="checkbox"]:checked + .service-name {
  color: var(--primary-color);
  font-weight: 600;
}

.service-name {
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.service-price {
  font-weight: 500;
  color: var(--primary-color);
  font-size: 0.875rem;
}

.service-description {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle:hover {
  background-color: var(--secondary-color);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.show {
  display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* Mobile menu toggle */
  .mobile-menu-toggle {
    display: block;
  }

  /* Sidebar mobile behavior */
  .sidebar {
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 101;
    height: 100vh;
    overflow-y: auto;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .sidebar-logo h1 {
    display: block;
  }
  
  .sidebar-nav-item span {
    display: inline;
  }
  
  /* Ensure logout button is visible on mobile */
  .sidebar .mt-auto {
    margin-top: auto !important;
    position: sticky;
    bottom: 0;
    background-color: white;
    padding: 15px !important;
    border-top: 1px solid var(--border-color);
  }
  
  /* Main content adjustments */
  .main-content {
    margin-left: 0;
    padding: 60px 15px 15px 15px;
  }
  
  /* Top bar mobile adjustments */
  .top-bar {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  
  .top-bar .page-title {
    font-size: 20px;
  }
  
  /* Stats cards mobile */
  .stat-cards {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
  }
  
  .stat-card {
    padding: 15px;
  }
  
  .stat-card-content h2 {
    font-size: 24px;
  }
  
  /* Card improvements for mobile */
  .card {
    margin-bottom: 15px;
    border-radius: 8px;
  }
  
  .card-header {
    padding: 15px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .card-body {
    padding: 15px;
  }
  
  /* Table responsive improvements */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: -15px;
    padding: 15px;
  }
  
  table {
    min-width: 700px;
    font-size: 13px;
  }
  
  table th,
  table td {
    padding: 8px 12px;
    white-space: nowrap;
  }
  
  table th {
    font-size: 12px;
    background-color: #f5f5f5;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  /* Action buttons mobile optimization */
  .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .btn-group .btn,
  .btn-edit,
  .btn-view,
  .btn-sync {
    font-size: 11px;
    padding: 4px 6px;
    margin: 0 2px 2px 0;
  }
  
  /* Filter form mobile adjustments */
  .card .row {
    margin: 0;
  }
  
  .card .row > * {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 15px;
  }
  
  .form-control, .form-select {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
  
  /* Modal mobile adjustments */
  .modal-dialog {
    margin: 10px;
    max-width: none;
    width: calc(100% - 20px);
  }
  
  .modal-content {
    border-radius: 8px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 15px;
  }
  
  /* Button improvements for mobile */
  .btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 15px;
  }
  
  .btn-add {
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
  }
  
  .btn-sm {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
  }
  
  /* Status badge adjustments */
  .status-badge {
    font-size: 11px;
    padding: 3px 6px;
  }
  
  /* Flash messages mobile */
  .flash-messages {
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .alert {
    padding: 12px;
    font-size: 14px;
  }
}

/* Very small screens (phones in portrait) */
@media (max-width: 480px) {
  .main-content {
    padding: 60px 10px 10px 10px;
  }
  
  .stat-cards {
    gap: 10px;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .stat-card-content h2 {
    font-size: 20px;
  }
  
  .stat-card-content p {
    font-size: 13px;
  }
  
  .page-title {
    font-size: 18px;
  }
  
  .card-header {
    padding: 12px;
  }
  
  .card-body {
    padding: 12px;
  }
  
  table {
    min-width: 600px;
    font-size: 12px;
  }
  
  table th,
  table td {
    padding: 6px 8px;
  }
  
  .modal-dialog {
    margin: 5px;
    width: calc(100% - 10px);
  }
}

/* Admin bookings table specific mobile fixes */
@media (max-width: 768px) {
  .admin-bookings-table {
    width: 100% !important;
    font-size: 12px !important;
  }
  
  .admin-bookings-table th,
  .admin-bookings-table td {
    padding: 6px 4px !important;
    vertical-align: top;
  }
  
  /* Allow text wrapping for better space usage */
  .admin-bookings-table td:nth-child(2),
  .admin-bookings-table td:nth-child(3),
  .admin-bookings-table td:nth-child(5) {
    white-space: normal;
  }
  
  /* Keep dates and actions compact */
  .admin-bookings-table td:nth-child(1),
  .admin-bookings-table td:nth-child(7),
  .admin-bookings-table td:nth-child(9) {
    white-space: nowrap;
  }
  
  .admin-bookings-table .small {
    font-size: 10px !important;
    line-height: 1.2;
  }
  
  .admin-bookings-table .badge {
    font-size: 9px !important;
    padding: 2px 4px !important;
  }
  
  /* Hide less important columns on small screens */
  .admin-bookings-table th:nth-child(6),
  .admin-bookings-table td:nth-child(6) {
    display: none; /* Hide Guests column */
  }
  
  .admin-bookings-table th:nth-child(4),
  .admin-bookings-table td:nth-child(4) {
    display: none; /* Hide Client column on mobile */
  }
  
  .admin-bookings-table th:nth-child(8),
  .admin-bookings-table td:nth-child(8) {
    display: none; /* Hide Status column on mobile */
  }
}

/* Very small screens - hide more columns */
@media (max-width: 480px) {
  .admin-bookings-table {
    width: 100% !important;
    font-size: 11px !important;
  }
  
  .admin-bookings-table th:nth-child(1),
  .admin-bookings-table td:nth-child(1) {
    display: none; /* Hide ID column */
  }
  
  .admin-bookings-table th:nth-child(7),
  .admin-bookings-table td:nth-child(7) {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Landscape phone optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .main-content {
    padding: 50px 10px 10px 10px;
  }
  
  .mobile-menu-toggle {
    top: 10px;
    left: 10px;
  }
}