/* --- AStA RENTAL PORTAL DESIGN --- */

.asta-rental-portal {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: #334155;
  margin: 2rem 0;
  max-width: 1200px;
  width: 100%;
}

.asta-rental-portal * {
  box-sizing: border-box;
}

/* Header */
.asta-rental-header {
  margin-bottom: 2rem;
  border-left: 4px solid #4f46e5;
  padding-left: 1rem;
}

.asta-rental-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
}

.asta-rental-header p {
  color: #64748b;
  margin: 0;
  font-size: 1rem;
}

/* Layout Grid */
.asta-rental-layout {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .asta-rental-layout {
    grid-template-columns: 1fr;
  }
}

/* Filters */
.asta-rental-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.filter-group select, .filter-group input {
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #fff;
  color: #334155;
  font-size: 0.9rem;
}

.filter-group select:focus, .filter-group input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px #e0e7ff;
}

/* Catalog Grid */
.asta-rental-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.asta-rental-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #64748b;
  font-style: italic;
}

/* Item Card */
.asta-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.asta-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  border-color: #4f46e5;
}

.asta-item-img {
  width: 100% !important;
  height: auto !important;
  max-height: 180px !important;
  object-fit: contain !important;
  border-radius: 6px !important;
  margin-bottom: 1rem !important;
  background-color: #f1f5f9 !important;
}

.asta-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.asta-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 9999px;
  background-color: #e0e7ff;
  color: #4f46e5;
}

.asta-item-location {
  font-size: 0.75rem;
  color: #64748b;
}

.asta-card h3 {
  font-size: 1.15rem;
  color: #0f172a;
  margin: 0.25rem 0 0.5rem 0;
  font-weight: 600;
}

.asta-item-desc {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.asta-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
  margin-top: auto;
}

.asta-item-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.asta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease-in-out;
}

.asta-btn-primary {
  background-color: #4f46e5;
  color: #ffffff;
}

.asta-btn-primary:hover {
  background-color: #4338ca;
}

.asta-btn-secondary {
  background-color: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.asta-btn-secondary:hover {
  background-color: #e2e8f0;
}

/* Sidebar Cart Card */
.asta-cart-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 100px;
  height: fit-content;
}

.asta-cart-card h3 {
  font-size: 1.25rem;
  margin: 0 0 1rem 0;
  color: #0f172a;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.asta-cart-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 0;
}

.asta-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}

.asta-cart-item-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem;
}

/* Form Fields */
.asta-form-group {
  margin-top: 1rem;
}

.asta-form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.25rem;
}

.asta-form-group input, .asta-form-group select, .asta-form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #ffffff;
  color: #334155;
  font-size: 0.85rem;
  font-family: inherit;
}

.asta-form-group input:focus, .asta-form-group select:focus, .asta-form-group textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px #e0e7ff;
}

/* Status Availability Box */
.asta-status-box {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border-left: 3px solid;
}

.asta-status-box.success {
  background-color: #d1fae5;
  color: #065f46;
  border-left-color: #10b981;
}

.asta-status-box.error {
  background-color: #fee2e2;
  color: #991b1b;
  border-left-color: #ef4444;
}

/* Toast */
.asta-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #1e293b;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  font-size: 0.85rem;
  z-index: 99999;
  display: none;
  animation: astaFadeInUp 0.3s ease-in-out;
}

@keyframes astaFadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* --- MODAL DIALOG --- */
.asta-modal {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

.asta-modal-content {
  background-color: #ffffff;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  position: relative;
  margin: auto 0;
  animation: astaFadeInUp 0.25s ease-out;
}

.asta-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s;
}

.asta-modal-close:hover {
  color: #0f172a;
}

/* --- CALENDAR COMPONENT --- */
.asta-cal-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.asta-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.asta-cal-header h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.asta-cal-nav {
  display: flex;
  gap: 0.5rem;
}

.asta-cal-btn {
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.15s;
}

.asta-cal-btn:hover {
  background-color: #e2e8f0;
}

.asta-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.asta-cal-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  padding: 4px 0;
}

.asta-cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  position: relative;
  cursor: default;
}

.asta-cal-day.empty {
  border: none;
  background: none;
}

.asta-cal-day.green {
  background-color: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.asta-cal-day.red {
  background-color: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
  font-weight: 600;
}

.asta-cal-day span.day-num {
  font-size: 0.95rem;
  font-weight: 600;
}

.asta-cal-day span.day-stock {
  font-size: 0.6rem;
  opacity: 0.8;
  margin-top: 2px;
}

.asta-cal-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #475569;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-color.green {
  background-color: #d1fae5;
  border: 1px solid #a7f3d0;
}

.legend-color.red {
  background-color: #fee2e2;
  border: 1px solid #fca5a5;
}

/* --- DETAIL POPUP LAYOUT --- */
.asta-card-clickable {
  cursor: pointer;
}

.asta-card-clickable:hover h3 {
  color: #4f46e5;
}

.asta-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  margin-top: 1rem;
  text-align: left;
}

.asta-modal-info-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.asta-modal-img {
  width: 100% !important;
  height: auto !important;
  max-height: 180px !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  background-color: #f1f5f9 !important;
}

.asta-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.asta-modal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background-color: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.meta-item {
  font-size: 0.85rem;
  color: #475569;
}

.meta-item strong {
  color: #0f172a;
  display: block;
  margin-bottom: 0.15rem;
}

.asta-modal-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #334155;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.asta-modal-desc h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
  position: sticky;
  top: 0;
  background-color: #ffffff;
}

.asta-modal-cal-col h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .asta-modal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* --- ADMIN CALENDAR OVERVIEW --- */
.asta-overview-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  background-color: #ffffff;
  padding: 1.5rem;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
}

.asta-overview-day {
  min-height: 120px;
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 8px;
  background-color: #f6f7f7;
  border: 1px solid #dcdcde;
}

.asta-overview-day.has-bookings {
  background-color: #ffffff;
}

.asta-overview-day .day-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1d2327;
  margin-bottom: 6px;
  border-bottom: 1px solid #f0f0f1;
  width: 100%;
  padding-bottom: 4px;
}

.asta-overview-day-bookings {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.asta-overview-day-bookings li {
  font-size: 0.72rem;
  margin: 0 0 5px 0;
  padding: 4px 6px;
  border-radius: 4px;
  color: #1d2327;
  line-height: 1.3;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.asta-overview-day-bookings li:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.asta-cal-renter-inline {
  font-weight: 400;
  opacity: 0.85;
}

/* Hover-Tooltip für Kalender-Termine in der Buchungsübersicht */
.asta-calendar-hover-tooltip {
  position: fixed;
  z-index: 100050;
  width: 310px;
  max-width: 92vw;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid #334155;
  padding: 10px 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.8rem;
  line-height: 1.45;
  pointer-events: none;
}

.asta-calendar-hover-tooltip .asta-tt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #334155;
  padding-bottom: 6px;
  margin-bottom: 7px;
  font-size: 0.84rem;
  color: #ffffff;
}

.asta-calendar-hover-tooltip .asta-tt-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.asta-calendar-hover-tooltip .asta-tt-badge.approved {
  background: #065f46;
  color: #d1fae5;
}

.asta-calendar-hover-tooltip .asta-tt-badge.pending {
  background: #92400e;
  color: #fef3c7;
}

.asta-calendar-hover-tooltip .asta-tt-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #e2e8f0;
  word-break: break-word;
}

.asta-calendar-hover-tooltip .asta-tt-body strong {
  color: #94a3b8;
  font-weight: 600;
}

.asta-calendar-hover-tooltip .asta-tt-footer {
  margin-top: 8px;
  padding-top: 5px;
  border-top: 1px dashed #334155;
  font-size: 0.72rem;
  color: #38bdf8;
  text-align: right;
  font-weight: 600;
}

.asta-overview-day-bookings li.booking-approved {
  background-color: #d1fae5;
  color: #065f46;
  border-left: 3px solid #10b981;
}

.asta-overview-day-bookings li.booking-pending {
  background-color: #fef3c7;
  color: #92400e;
  border-left: 3px solid #f59e0b;
}

.hide-pending .booking-pending {
  display: none !important;
}

.hide-approved .booking-approved {
  display: none !important;
}

@media (max-width: 900px) {
  .asta-overview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .asta-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* --- LIGHTBOX FOR LARGE IMAGE --- */
.asta-lightbox {
  display: none;
  position: fixed;
  z-index: 20000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: astaFadeIn 0.25s ease-out;
}

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

.asta-lightbox-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  animation: astaZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes astaZoomIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.asta-lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: #f1f5f9;
  font-size: 3rem;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
}

.asta-lightbox-close:hover {
  color: #ffffff;
}

/* --- MULTI-IMAGE SLIDER --- */
.asta-modal-slider-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.asta-modal-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.asta-modal-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asta-modal-slide.active {
  opacity: 1;
  visibility: visible;
}

.asta-slider-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  max-height: 100% !important;
}

/* Arrows */
.asta-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(15, 23, 42, 0.4);
  color: #ffffff;
  border: none;
  font-size: 1.25rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  z-index: 10;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  user-select: none;
  line-height: 1;
}

.asta-slider-arrow:hover {
  background-color: rgba(15, 23, 42, 0.7);
}

.asta-slider-arrow.prev {
  left: 10px;
}

.asta-slider-arrow.next {
  right: 10px;
}

/* Dots */
.asta-slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.asta-slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(15, 23, 42, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.asta-slider-dot.active {
  background-color: #4f46e5;
  transform: scale(1.2);
}

/* Backend Gallery Style */
.asta-gallery-thumb:hover .asta-gallery-remove {
  background: #ef4444 !important;
}
