/* =================================================================
   RESPONSIVE DESIGN FOR USER MANAGEMENT SYSTEM
   Mobile-First Approach with Tablet and Desktop Breakpoints
   ================================================================= */

/* =================================================================
   BASE / MOBILE STYLES (Default - 320px to 767px)
   ================================================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure images and videos are responsive */
img, video {
  max-width: 100%;
  height: auto;
}

/* Container for content */
.container {
  width: 100%;
  max-width: 100%;
  padding: 0 16px;
  margin: 0 auto;
}

/* Header adjustments for mobile */
.header {
  padding: 12px 16px !important;
  position: relative;
}

.header-title {
  font-size: 18px !important;
  margin: 0 !important;
}

/* Back buttons */
.back-btn, .back-button {
  padding: 8px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Cards and panels */
.card, .panel, .box {
  margin: 12px 0 !important;
  padding: 16px !important;
  border-radius: 12px !important;
}

/* Buttons */
button, .btn, input[type="submit"] {
  padding: 12px 20px !important;
  font-size: 14px !important;
  min-height: 44px !important;
  border-radius: 8px !important;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
  width: 100% !important;
  padding: 12px 16px !important;
  font-size: 16px !important;
  min-height: 44px !important;
  border-radius: 8px !important;
  box-sizing: border-box;
}

/* Tables - make them scrollable on mobile */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px 8px !important;
  font-size: 14px !important;
}

/* Grid layouts for mobile */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Modals */
.modal-content {
  width: 95% !important;
  max-width: 500px !important;
  margin: 20px auto !important;
  padding: 20px !important;
  border-radius: 12px !important;
}

/* Navigation menu */
.menu-item {
  padding: 16px !important;
  font-size: 14px !important;
  border-radius: 8px !important;
}

.menu-icon {
  font-size: 20px !important;
  margin-right: 12px !important;
}

/* Property cards */
.property-card {
  padding: 16px !important;
  margin: 12px 0 !important;
  border-radius: 12px !important;
}

.property-image {
  width: 100% !important;
  height: 180px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
}

/* Dashboard stats */
.stat-card {
  padding: 16px !important;
  margin: 8px 0 !important;
  border-radius: 12px !important;
  min-height: 100px !important;
}

.stat-value {
  font-size: 24px !important;
  font-weight: bold !important;
}

.stat-label {
  font-size: 12px !important;
  opacity: 0.7;
}

/* =================================================================
   TABLET STYLES (768px to 1023px)
   ================================================================= */

@media (min-width: 768px) {
  .container {
    max-width: 720px;
    padding: 0 24px;
  }

  .header-title {
    font-size: 22px !important;
  }

  .card, .panel, .box {
    margin: 16px 0 !important;
    padding: 24px !important;
    border-radius: 16px !important;
  }

  button, .btn, input[type="submit"] {
    padding: 14px 28px !important;
    font-size: 15px !important;
    min-height: 48px !important;
  }

  /* 2-column grid for tablets */
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  table th,
  table td {
    padding: 14px 12px !important;
    font-size: 15px !important;
  }

  .modal-content {
    width: 85% !important;
    max-width: 600px !important;
    padding: 28px !important;
  }

  .property-card {
    padding: 20px !important;
    margin: 16px 0 !important;
  }

  .property-image {
    height: 220px !important;
  }

  .stat-card {
    padding: 20px !important;
    margin: 12px 0 !important;
    min-height: 120px !important;
  }

  .stat-value {
    font-size: 28px !important;
  }

  .stat-label {
    font-size: 13px !important;
  }

  .menu-item {
    padding: 18px !important;
    font-size: 15px !important;
  }
}

/* =================================================================
   DESKTOP STYLES (1024px and above)
   ================================================================= */

@media (min-width: 1024px) {
  .container {
    max-width: 960px;
    padding: 0 32px;
  }

  .header {
    padding: 16px 32px !important;
  }

  .header-title {
    font-size: 26px !important;
  }

  .card, .panel, .box {
    margin: 20px 0 !important;
    padding: 32px !important;
    border-radius: 20px !important;
  }

  button, .btn, input[type="submit"] {
    padding: 16px 32px !important;
    font-size: 16px !important;
    min-height: 52px !important;
  }

  /* 3-column grid for desktop */
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  table th,
  table td {
    padding: 16px !important;
    font-size: 16px !important;
  }

  .modal-content {
    width: 70% !important;
    max-width: 800px !important;
    padding: 36px !important;
  }

  .property-card {
    padding: 24px !important;
    margin: 20px 0 !important;
  }

  .property-image {
    height: 260px !important;
  }

  .stat-card {
    padding: 24px !important;
    margin: 16px 0 !important;
    min-height: 140px !important;
  }

  .stat-value {
    font-size: 32px !important;
  }

  .stat-label {
    font-size: 14px !important;
  }

  .menu-item {
    padding: 20px !important;
    font-size: 16px !important;
  }

  .menu-icon {
    font-size: 24px !important;
    margin-right: 16px !important;
  }

  /* Hover effects for desktop */
  button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  }

  .menu-item:hover {
    transform: translateX(4px);
  }
}

/* =================================================================
   LARGE DESKTOP STYLES (1440px and above)
   ================================================================= */

@media (min-width: 1440px) {
  .container {
    max-width: 1200px;
  }

  .grid.cols-4 {
    grid-template-columns: repeat(5, 1fr);
  }

  .header-title {
    font-size: 30px !important;
  }

  .stat-value {
    font-size: 36px !important;
  }
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

/* Hide on mobile */
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .hide-tablet {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 1024px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Show only on mobile */
.show-mobile {
  display: block !important;
}

@media (min-width: 768px) {
  .show-mobile {
    display: none !important;
  }
}

/* Responsive text alignment */
.text-center-mobile {
  text-align: center;
}

@media (min-width: 768px) {
  .text-center-mobile {
    text-align: left;
  }
}

/* Responsive spacing */
.mb-mobile-2 {
  margin-bottom: 8px !important;
}

@media (min-width: 768px) {
  .mb-mobile-2 {
    margin-bottom: 16px !important;
  }
}

/* Flexible containers */
.flex-mobile-column {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .flex-mobile-column {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* =================================================================
   SPECIFIC COMPONENT FIXES
   ================================================================= */

/* Wallet info modal */
.wallet-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

/* Property list grid */
.property-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .property-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .property-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* Dashboard menu */
.dashboard-menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
}

@media (min-width: 768px) {
  .dashboard-menu {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 24px;
  }
}

@media (min-width: 1024px) {
  .dashboard-menu {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 32px;
  }
}

/* Transaction history */
.transaction-item {
  padding: 12px;
  margin: 8px 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 768px) {
  .transaction-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    margin: 12px 0;
  }
}

/* Form layouts */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .form-row {
    flex-direction: row;
    gap: 16px;
  }
  
  .form-row > * {
    flex: 1;
  }
}

/* Admin tables */
.admin-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

@media (min-width: 1024px) {
  .admin-table-container {
    overflow-x: visible;
  }
}

/* =================================================================
   ACCESSIBILITY & TOUCH TARGETS
   ================================================================= */

/* Ensure all touch targets are at least 44x44px on mobile */
@media (max-width: 767px) {
  a, button, input[type="submit"], input[type="button"], .clickable {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Focus states for accessibility */
*:focus {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
}

button:focus, a:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
}

/* =================================================================
   PRINT STYLES
   ================================================================= */

@media print {
  .no-print,
  .back-btn,
  .back-button,
  button,
  .btn {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
}


