/* RentSystem — custom.css */

* {
  box-sizing: border-box;
}

body {
  font-family: 'Raleway', sans-serif;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #a5f3fc;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #22d3ee;
}

/* Table styling */
table {
  border-collapse: collapse;
  width: 100%;
}

/* Print styles */
@media print {
  #sidebar,
  #sidebarOverlay,
  header,
  .no-print {
    display: none !important;
  }
  main {
    padding: 0 !important;
  }
  body {
    background: white !important;
  }
}

/* Typeahead results */
#tenantResults {
  position: absolute;
  z-index: 50;
  width: 100%;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1);
  max-height: 200px;
  overflow-y: auto;
}

/* Sidebar Transitions */
#sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  z-index: 50;
}

/* Sidebar Overlay */
#sidebarOverlay {
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
  z-index: 40;
}

#sidebarOverlay.hidden {
  display: none;
  opacity: 0;
}

#sidebarOverlay:not(.hidden) {
  display: block;
  opacity: 1;
}

/* Mobile Adjustments */
@media (max-width: 1023px) {
  #sidebar {
    transform: translateX(-100%);
  }

  .sidebar-open #sidebar {
    transform: translateX(0);
  }
  
  /* Ensure header remains accessible */
  header {
    position: sticky;
    top: 0;
    z-index: 30;
    background-color: white;
  }

  /* Ensure main content doesn't scroll when sidebar is open */
  body.sidebar-open {
    overflow: hidden;
  }
}

/* Table Responsiveness Utilities */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.table-responsive table {
  min-width: 600px; /* Force scroll on very small screens */
}

/* Form stacking for mobile */
@media (max-width: 640px) {
  .grid-cols-2, .md:grid-cols-2, .lg:grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }
  
  .flex-wrap {
    flex-direction: column;
  }
  
  .flex-wrap > * {
    width: 100% !important;
  }
}

@keyframes fadeInTop {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.fade-in-top {
  animation: fadeInTop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Glassmorphism & Modern UI */
.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-input {
  background: rgba(0, 0, 0, 0.2) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  transition: all 0.3s ease;
}

.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

.glass-input:focus {
  background: rgba(0, 0, 0, 0.3) !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
  outline: none;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
