/* =========================================
   WP HOURLY RENTALS – FRONTEND STYLES v1.8.3
   ========================================= */

/* ========== GLOBAL RESET & BASE STYLES ========== */
.whr-files-grid, .whr-my-rentals {
  font-family: 'Inter', Arial, sans-serif;
  color: #222;
  box-sizing: border-box;
}

.whr-files-grid img,
.whr-card img {
  border-radius: 10px;
  object-fit: cover;
}

button,
.button {
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

button:hover,
.button:hover {
  opacity: 0.9;
}

/* ========== FILTER FORM ========== */
#whr-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 25px;
  background: #f9f9f9;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #e3e3e3;
}

#whr-filter-form select,
#whr-filter-form input {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

#whr-filter-form input[type="text"] {
  flex: 1;
}

/* ========== FILE GRID (MARKETPLACE) ========== */
#whr-results,
.whr-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.whr-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  padding: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.whr-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.whr-card h3 {
  font-size: 16px;
  margin-top: 10px;
  margin-bottom: 5px;
  color: #111;
}

.whr-card p {
  font-size: 13px;
  color: #555;
  margin: 4px 0;
  line-height: 1.5;
}

.whr-card select,
.whr-card button {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.whr-card button {
  background: #0073aa;
  color: #fff;
  border: none;
  transition: background 0.25s ease;
}

.whr-card button:hover {
  background: #005e8c;
}

/* ========== MODAL STYLES ========== */
#whr-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#whr-modal-content {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  position: relative;
  animation: fadeIn 0.25s ease;
}

#whr-close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  border: none;
  background: none;
  color: #888;
  cursor: pointer;
}

#whr-close-modal:hover {
  color: #111;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ========== MY RENTALS TABLE ========== */
.whr-my-rentals {
  margin-top: 30px;
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.whr-my-rentals table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

.whr-my-rentals th,
.whr-my-rentals td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

.whr-my-rentals th {
  background: #f5f5f5;
  font-weight: 600;
}

.whr-my-rentals tr:nth-child(even) {
  background: #fafafa;
}

.whr-my-rentals td strong {
  color: #111;
}

.whr-my-rentals .button {
  padding: 6px 10px;
  font-size: 13px;
  margin: 3px 0;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

/* STATUS COLORS */
.whr-my-rentals td[style*="green"] {
  color: #008000 !important;
  font-weight: 600;
}
.whr-my-rentals td[style*="red"] {
  color: #d93025 !important;
  font-weight: 600;
}

/* COUNTDOWN TIMER */
.whr-countdown {
  font-weight: bold;
  color: #0073aa;
}

/* ========== PROGRESS BAR ========== */
.whr-progress {
  width: 100%;
  height: 6px;
  background: #eee;
  border-radius: 4px;
  margin-top: 4px;
}

.whr-progress div {
  height: 6px;
  background: #28a745;
  border-radius: 4px;
}

/* ========== ALERT MESSAGES (SUCCESS / ERROR) ========== */
.whr-alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.whr-alert-success {
  background: #e6f4ea;
  color: #1e4620;
  border: 1px solid #b7e4c7;
}

.whr-alert-error {
  background: #fdecea;
  color: #611a15;
  border: 1px solid #f5c2c0;
}

.whr-alert svg {
  flex-shrink: 0;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  #whr-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  #whr-filter-form input,
  #whr-filter-form select {
    width: 100%;
  }

  #whr-results,
  .whr-files-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }

  .whr-card h3 {
    font-size: 14px;
  }

  .whr-card p {
    font-size: 12px;
  }

  .whr-my-rentals table,
  .whr-my-rentals thead,
  .whr-my-rentals tbody,
  .whr-my-rentals th,
  .whr-my-rentals td,
  .whr-my-rentals tr {
    display: block;
  }

  .whr-my-rentals tr {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
  }

  .whr-my-rentals th {
    display: none;
  }

  .whr-my-rentals td {
    border: none;
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
  }

  .whr-my-rentals td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #333;
  }
}

@media (max-width: 480px) {
  #whr-results,
  .whr-files-grid {
    grid-template-columns: 1fr;
  }

  .whr-card {
    padding: 8px;
  }

  .whr-card h3 {
    font-size: 14px;
  }

  .whr-card button {
    font-size: 13px;
  }
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
  body {
    background: #121212;
    color: #eee;
  }

  .whr-card,
  .whr-my-rentals,
  #whr-modal-content {
    background: #1e1e1e;
    border-color: #333;
    color: #ddd;
  }

  .whr-my-rentals th {
    background: #333;
    color: #eee;
  }

  .whr-card button {
    background: #0099ff;
  }

  .whr-card:hover {
    box-shadow: 0 3px 10px rgba(255,255,255,0.05);
  }
}