/* Base Styles */
* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #f8f9fa;
}

body {
  padding: 5px;
  margin: 5px;
}

.hidden {
  display: none;
}

/* Layout & Forms */
.select-container {
  display: flex;
  justify-content: left;
  align-items: first baseline;
}

.styled-select {
  padding: 10px 15px;
  font-size: 20px;
  border: none;
  border-radius: 5px;
  background-color: #f9f9f9;
  width: auto;
  cursor: pointer;
}

/* Status Overview */
.status-overview {
  width: 600px;
  margin: 10px auto;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
}

.stats-group {
  flex: 1;
}

.stats-divider {
  width: 1px;
  background-color: #eee;
  margin: 0 20px;
}

.overview-header {
  font-size: 15px;
  text-align: center;
  font-weight: 700;
  margin-bottom: 10px;
  padding-left: 5px;
}

.stats-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 20px;
}

.stats-container.daily {
  justify-content: center;
}

.stats-container.current {
  justify-content: space-between;
}

.overview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: auto;
}

.overview-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 2px;
}

.overview-value {
  font-size: 18px;
  font-weight: bold;
}

/* Status-specific colors */
.overview-value.checkins {
  color: #4caf50;
}
.overview-value.checkouts {
  color: #f44336;
}
.overview-value.clean {
  color: #2196f3;
}
.overview-value.occupied {
  color: #ff9800;
}
.overview-value.dirty {
  color: #795548;
}

/* Mobile responsive */
@media (min-width: 1201px) {
  /* Large screens */
  .room-no {
    width: 8%;
  }

  .status-cell {
    width: 22%;
  }

  .checkin-time,
  .checkout-time {
    width: 15%;
  }

  .note {
    width: 35%;
  }
}
@media (max-width: 768px) {
  .status-overview {
    padding: 10px;
    width: calc(100% - 20px);
    margin: 10px;
    flex-direction: column;
  }

  .stats-group:last-child {
    margin-bottom: 0;
  }

  .stats-divider {
    width: 100%;
    height: 1px;
    margin: 15px 0;
  }

  .stats-container.daily {
    gap: 30px;
    justify-content: center;
  }

  .overview-header {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .overview-label {
    font-size: 12px;
  }

  .overview-value {
    font-size: 16px;
  }

  .overview-item {
    min-width: 70px;
  }

  .stats-container {
    gap: 10px;
  }
}
/* Table Styles */
table {
  width: calc(100% - 40px);
  margin: 30px auto;
  border-radius: 8px;
  overflow: hidden;
  border-collapse: collapse;
  border-spacing: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

th,
td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid #6c757d;
  border-right: 1px solid #6c757d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  background-color: #3a3a3a;
  color: white;
  font-weight: 600;
  border-left: 1px solid #6c757d;
}

tr:nth-child(even) {
  background-color: #f8f9fa;
}

.checkin-time,
.checkout-time {
  font-weight: bold;
}

/* Room Status Styles */

.free .status-cell::after {
  content: " ✅";
}
.repair .status-cell::after {
  content: " 🔧";
}

/* Room Row Styles */
.room-row {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

/* .room-row.dirty {
  background-color: #ffe0b2;
}
.room-row.duration-gio {
  background-color: #1e7927;
  color: #f9f9f9;
}
.room-row.duration-dem {
  background-color: #146b62;
  color: #f9f9f9;
}
.room-row.duration-ngay {
  background-color: #2550a7;
  color: #f9f9f9;
} */

.room-row.dirty {
  background-color: #f9e0ae; 
}

.room-row.duration-gio {
  background-color: #2d9420db;
  color: #ffffff;
}

.room-row.duration-dem {
  background-color: #104e48e8; 
  color: #ffffff;
}

.room-row.duration-ngay {
  background-color: #23407b;
  color: #ffffff;
}

/* .room-row.dirty {
  background-color: #ffe0b2;
}
.room-row.duration-gio {
  background-color: #385e39;
  color: #f9f9f9;
}
.room-row.duration-ngay {
  background-color: #31559e;
  color: #f9f9f9;
}
.room-row.duration-dem {
  background-color: #0781e5;
  color: #f9f9f9;
} */

.room-row:hover {
  filter: brightness(1.25);
}

/* Note Cell */
.note {
  text-align: left;
  white-space: nowrap;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 10px;
  position: relative;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-body {
  margin-top: 20px;
  line-height: 1.5;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: black;
}

/* loading */
.loading-bar {
  height: 5px;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background: linear-gradient(to right, #4caf50, #8bc34a, #4caf50);
  background-size: 200% 100%;
  transform: translateX(-100%);
  z-index: 1000;
}

.loading .loading-bar {
  animation: loading-animation 2s ease-in-out infinite;
}

@keyframes loading-animation {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  20% {
    transform: translateX(-50%);
    opacity: 1;
  }
  80% {
    transform: translateX(50%);
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Select Container */
.select-container {
  display: flex;
  justify-content: center;
  padding: 16px;
  margin: 10px auto;
  max-width: 500px;
}

/* Select Styling */
.styled-select {
  width: 100%;
  padding: 14px 40px;
  font-size: 16px;
  background-color: white;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  text-align: center;
  text-align-last: center;

  /* Custom dropdown arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
}

.styled-select option {
  text-align: center;
}

/* Hover state */
.styled-select:hover {
  border-color: #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Focus state */
.styled-select:focus {
  outline: none;
  border-color: #ccc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile adjustments */

@media (max-width: 768px) {
  body {
    padding: 0px;
    margin: 0px;
  }
  table {
    width: calc(100% - 20px);
    margin: 0 auto;
    margin-bottom: 20px;
    padding-bottom: 5px;
    font-size: 14px;
  }
  td,
  th {
    white-space: normal;
    line-height: 1.2;
    height: auto;
    min-height: 44px;
    vertical-align: middle;
  }

  .room-no {
    width: 50px;
    min-width: 50px;
  }

  .select-container {
    padding: 12px;
    margin: 5px 5px;
  }

  .styled-select {
    padding: 12px 16px;
    font-size: 15px;
  }

  .status-cell {
    width: 70px;
  }

  .checkin-time,
  .checkout-time {
    width: 80px;
  }

  .note {
    min-width: 30px;
    padding-left: 5px;
    padding-right: 5px;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 15px;
  }
}

/* Large screen styles */
@media (min-width: 769px) {
  table {
    max-width: 1400px;
  }

  .room-no {
    width: 80px;
  }

  .status-cell {
    width: 100px;
  }

  .checkin-time,
  .checkout-time {
    width: 140px;
  }

  .note {
    padding-right: 20px;
  }

  th,
  td {
    padding: 12px 8px;
  }
}

.room-type {
  display: inline-block;
  font-size: 0.75em;
  padding: 2px 6px;
  margin-left: 4px;
  border-radius: 4px;
  font-weight: 500;
  color: #fff;
}

.room-type-đơn {
  background-color: #3f3f3d;  
}

.room-type-đôi {
  background-color: #805ad5;  
}

.room-type-ba {
  background-color: #38a169;  
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .room-type {
    font-size: 0.7em;
    padding: 1px 4px;
    margin-left: 2px;
  }
}
