/* Global Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Calendar Styles */
.calendar-container {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 1px;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 1px;
}

.calendar-day {
  min-height: 100px;
  border: 1px solid #e5e7eb;
  padding: 5px;
  position: relative;
  background-color: white;
}

.calendar-day.today {
  background-color: #f9fafb;
  font-weight: 600;
}

.calendar-day-number {
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 14px;
  color: #6b7280;
}

.reservation {
  margin-top: 20px;
  margin-bottom: 2px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: #1f2937;
  transition: all 0.2s ease;
}

.reservation:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Reservation platform colors */
.reservation-booking {
  background-color: #dbeafe;
  border-left: 3px solid #2563eb;
  color: #1e40af;
}

.reservation-airbnb {
  background-color: #fce7e6;
  border-left: 3px solid #dc2626;
  color: #991b1b;
}

.reservation-abritel {
  background-color: #dcfce7;
  border-left: 3px solid #16a34a;
  color: #15803d;
}

.reservation-ical {
  background-color: #f3e8ff;
  border-left: 3px solid #7c3aed;
  color: #5b21b6;
}

.reservation-other {
  background-color: #fef3c7;
  border-left: 3px solid #d97706;
  color: #92400e;
}

/* Property indicator */
.property-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

/* Animation */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* Utility classes for responsive design */
@media (max-width: 576px) {
  .xs\:inline {
    display: inline;
  }
}

/* Button enhancement for mobile */
@media (hover: none) and (pointer: coarse) {
  button, 
  [role="button"],
  input[type="submit"],
  input[type="button"] {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  
  button:active, 
  [role="button"]:active,
  input[type="submit"]:active,
  input[type="button"]:active {
    transform: scale(0.97);
  }
}

/* iCal Sync Status Animations */
.sync-status-update {
  animation: statusPulse 0.5s ease-out;
}

@keyframes statusPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* List View Styles */
.list-table th,
.list-table td {
  padding: 0.5rem 1rem;
  text-align: left;
}

.list-table th {
  background-color: #f3f4f6;
  font-weight: 600;
  color: #374151;
}

.list-table tr:nth-child(even) {
  background-color: #f9fafb;
}

.list-table tr:hover {
  background-color: #f3f4f6;
}

/* Revenue Report Styles */
.revenue-bar {
  height: 12px;
  border-radius: 6px;
  background-color: #e5e7eb;
  overflow: hidden;
  position: relative;
}

.revenue-bar-fill {
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 6px;
  transition: width 0.5s ease-out;
}

.revenue-card {
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background-color: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Login Styles */
.login-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  transition: border-color 0.2s;
}

.login-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-button {
  width: 100%;
  padding: 0.75rem;
  background-color: #6366f1;
  color: white;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.login-button:hover {
  background-color: #4f46e5;
}

.login-button:disabled {
  background-color: #c7d2fe;
  cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .calendar-grid, .calendar-header {
    grid-template-columns: repeat(7, minmax(40px, 1fr));
  }
  
  .calendar-day {
    min-height: 70px;
    padding: 2px;
  }
  
  .calendar-day-number {
    font-size: 12px;
    top: 2px;
    right: 4px;
  }
  
  .reservation {
    margin-top: 14px;
    padding: 2px 4px;
    font-size: 10px;
  }
  
  .list-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .login-container {
    max-width: 90%;
    padding: 1.5rem;
  }
  
  /* Fix for small screens */
  .calendar-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Improved button styling for mobile */
  button {
    white-space: normal;
    word-break: break-word;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    padding: 8px 12px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Increase touch target size for icon buttons */
  button.text-gray-500, button.text-gray-600 {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Add proper spacing between mobile buttons */
  .flex button + button {
    margin-left: 8px;
  }
  
  /* Make tab buttons more compact but ensure they're tappable */
  .tab-button {
    padding: 8px 10px !important;
    font-size: 0.75rem !important;
    min-height: 44px;
  }
  
  /* Enhance primary action buttons */
  .bg-blue-600 {
    padding: 10px 16px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  }
}

/* Extra small device fixes */
@media (max-width: 480px) {
  .calendar-grid, .calendar-header {
    grid-template-columns: repeat(7, minmax(30px, 1fr));
  }
  
  .calendar-day {
    min-height: 60px;
  }
  
  /* Full-width buttons for very small screens */
  .flex.justify-between button {
    padding: 8px 10px;
  }
  
  /* Stack buttons on very small screens when needed */
  .flex.flex-wrap {
    gap: 8px;
  }
  
  /* Adjust icon spacing on small screens */
  button i {
    margin-right: 6px;
  }
  
  /* Modal action buttons */
  .flex.justify-end button {
    min-width: 80px;
    padding: 10px 12px;
  }
}

/* Improved debugging for reservations */
.calendar-day:has(.reservation) {
  background-color: #fafafa;
}

/* Better visual feedback for interactive elements */
.reservation:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Enhanced visibility for iCal reservations */
.reservation-ical {
  font-weight: 500;
  border-left-width: 4px;
}
