/* =========================
   1. ΒΑΣΙΚΑ ΣΤΟΙΧΕΙΑ & LAYOUT
========================= */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6fa; /* Χρώμα φόντου για γενική εφαρμογή */
}

.container {
  padding: 20px;
}

.topbar {
  background: #1f2937;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.oa-page {
  background: #e7e8ec; /* Χρώμα φόντου για σελίδες κρατήσεων/admin */
  min-height: 100vh;
}

.oa-main {
  width: 90%;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

/* Responsive improvements for all pages */
@media (max-width: 768px) {
  .oa-main {
    width: 100%;
    padding: 0 10px;
  }
  
  /* Ensure horizontal scroll for tables */
  .table-responsive {
    overflow-x: auto;
    display: block;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  
  .table-responsive table {
    min-width: 600px;
    width: 100%;
  }
  
  /* General table horizontal scroll */
  table {
    min-width: 100%;
  }
  
  /* Specific table fixes */
  .admin-members-table,
  .members-table,
  .ranking-table {
    min-width: 600px;
  }
  
  /* Prevent body overflow */
  body {
    overflow-x: hidden;
  }
  
  /* Cards and containers */
  .card,
  .profile-card,
  .mg-btn {
    min-width: 0;
  }
  
  /* Profile grid */
  .profile-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Management grid */
  .mg-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- ΓΕΝΙΚΟ FIX για κείμενα --- */
.announcement-box p,
.dashboard-text,
.dashboard-announcement,
.card-body,
div, span, p {
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
}


/* =========================
   2. ΣΤΟΙΧΕΙΑ ΦΟΡΜΑΣ & ΚΟΥΜΠΙΑ
========================= */
.btn {
  display: inline-block;
  margin-bottom: 10px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
}

.btn-primary {
  background: #3a195f;
  border: none;
  padding: 9px 18px;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #511f85;
}

.form-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 13px;
}


/* =========================
   3. ΣΕΛΙΔΑ LOGIN
========================= */
.oa-bg {
  background: #e7e8ec;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 30px 15px;
}

.login-card {
  background: #fff;
  width: min(520px, 100%);
  border-radius: 16px;
  padding: 32px 40px 36px;
  box-shadow: 0 14px 45px rgba(15, 23, 42, 0.12);
  text-align: left;
}

.logo-wrap {
  text-align: center;
  margin-bottom: 12px;
}

.club-logo {
  width: 120px;
  height: auto;
}

.login-title {
  text-align: left;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form label {
  font-weight: 500;
  font-size: 14px;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #374151;
}

.extra-links {
  margin-top: 4px;
}

.extra-links .forgot {
  font-size: 13px;
  color: #3a195f;
  text-decoration: none;
}

.extra-links .forgot:hover {
  text-decoration: underline;
}

.lang-wrap {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Login Responsiveness */
@media (max-width: 540px) {
  .login-card {
    padding: 28px 20px;
  }
  .login-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-primary {
    width: 100%;
    text-align: center;
  }
}


/* =========================
   4. NAVIGATION (TOP & BOTTOM)
========================= */

/* Κεντρικό στυλ menu */
.oa-topmenu,
.oa-bottom-menu {
  background: #fff;
}

.oa-topmenu {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px; /* Απόσταση μεταξύ των items */
  padding: 8px 20px 8px;
  color: #4b2a78;
  font-weight: 500;
  position: relative;
}

.oa-header-logo {
  margin-right: auto; /* Σπρώχνει το logo αριστερά */
  padding-right: 20px;
  border-right: 1px solid rgba(75, 42, 120, 0.1);
}

/* Responsive improvements */
@media (max-width: 768px) {
  .oa-header-logo {
    padding-right: 10px;
    border-right: none;
  }
}

.oa-bottom-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0 14px;
  border-top: 1px solid rgba(0,0,0,0.08);
  z-index: 100;
}

/* Κοινό στυλ για τα items */
.oa-topmenu .oa-menu-item,
.oa-bottom-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af; /* Αρχικό χρώμα */
  text-decoration: none;
  transition: all 0.2s ease;
}

.oa-menu-item {
  color: inherit;
}

/* Hover & Active states */
.oa-topmenu .oa-menu-item:hover,
.oa-bottom-menu a:hover {
  color: #4b2a78;
}

.oa-topmenu .oa-menu-item.oa-menu-active,
.oa-bottom-menu a.active {
  color: #4b2a78; /* Active χρώμα */
  border-bottom: 3px solid #4b2a78;
  padding-bottom: 6px;
}

/* Icons */
.icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
  transition: color 0.2s ease, transform 0.2s ease;
}

.oa-menu-item.oa-menu-active .icon,
.oa-bottom-menu a.active .icon {
  color: #4b2a78;
  transform: scale(1.1);
}

.oa-bottom-menu span {
  font-size: 12px;
}


/* =========================
   5. ΣΕΛΙΔΑ ΚΡΑΤΗΣΕΩΝ (BOOKINGS)
========================= */

/* --- Τίτλοι / Ημερομηνίες --- */
.oa-logo-center {
  text-align: center;
  margin: 12px 0 0;
}
.oa-logo-center img {
  width: 110px;
}

.oa-title-row {
  text-align: center;
  margin-top: 10px;
}
.oa-title-row h1 {
  font-size: 26px;
  color: #4b2a78;
  letter-spacing: .5px;
}
.oa-title-icon {
  font-size: 18px;
  margin-left: 4px;
}

.oa-date-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 14px 0 16px;
}
.oa-date-range {
  font-weight: 600;
  color: #304043;
}
.oa-arrow {
  width: 28px;
  height: 28px;
  border: 1px solid #4b2a78;
  border-radius: 999px;
  display:flex;
  justify-content:center;
  align-items:center;
  color:#4b2a78;
  text-decoration:none;
  font-weight:700;
}

/* --- Πλαϊνά Κουμπιά (i) --- */
.oa-legend-toggle {
  position: fixed;
  top: 170px;
  width: 48px;
  height: 48px;
  border: 2px solid #4b2a78;
  border-radius: 18px;
  background: #fff;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size: 20px;
  color: #4b2a78;
  cursor: pointer;
  z-index: 60;
}
.oa-left-btn { left: 30px; }
.oa-right-btn { right: 30px; }

/* --- Υπόμνημα (Legend) --- */
.oa-legend {
  position: fixed;
  top: 240px;
  right: 30px;
  left: auto;
  transform: none;
  background: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  display: flex;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 70;
}
.oa-legend.show {
  opacity: 1;
  top: 240px;
  pointer-events: auto;
}
.lg {
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  color: #fff;
  font-weight: 500;
  font-size: 13px;
}
.lg-old { background: #c0c4c7; color: #fff; }
.lg-free { background: #f3f4f6; color: #4b2a78; border:1px solid #e5e7eb; }
.lg-booked { background: #006838; }
.lg-mine { background: #78b521; }
.lg-ranking { background: #c62828; }


/* --- Δομή Περιεχομένου Ημέρας --- */
.oa-booking-wrapper {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 60px;
  margin-bottom: 120px;
}

.oa-day-block {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  padding: 12px 12px 16px;
  max-width: 1360px;
  margin: 0 auto 20px auto;
}

.oa-day-header {
  background: transparent; /* Τροποποιήθηκε */
  color: #4b2a78; /* Τροποποιήθηκε */
  padding: 0; /* Τροποποιήθηκε */
  margin-bottom: 12px;
  font-weight: 800; /* Τροποποιήθηκε */
  font-size: 18px; /* Τροποποιήθηκε */
  border-radius: 0; /* Τροποποιήθηκε */
  display: inline-block;
}


/* =========================
   6. ΠΙΝΑΚΑΣ ΚΡΑΤΗΣΕΩΝ (GRID)
========================= */

/* --- Κεντράρισμα Όλων των Κουτιών --- */
.oa-time-slot,
.oa-court-col,
.oa-hour-group,
.oa-time-day {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* --- Header Ωρών (Μωβ Μπάρα) --- */
.oa-time-header-row {
  display: grid;
  grid-template-columns: 140px repeat(12, 90px);
  gap: 2px; /* Τροποποιήθηκε σε 2px */
  position: relative;
}

.oa-time-day {
  background: #4b2a78;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 14px 0 0 14px;
  height: 58px;
  position: sticky;
  left: 0;
  z-index: 3;
}

.oa-hour-group {
  background: #4b2a78;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid rgba(255,255,255,0.12);
  grid-column: span 2;
  height: 58px;
}

.oa-hour-group:last-child {
  border-radius: 0 14px 14px 0;
}

/* --- Row Γηπέδων --- */
.oa-court-row {
  display: grid;
  grid-template-columns: 140px repeat(12, 90px);
  gap: 2px;
  overflow-x: auto;
  position: relative;
  margin-bottom: 2px;
}

.oa-court-col {
  background: rgba(75,42,120,0.15);
  border-radius: 14px 0 0 14px;
  padding: 7px 10px;
  font-weight: 500;
  min-height: 42px;
  position: sticky;
  left: 0;
  z-index: 3;
}

/* --- Slots (Κουτάκια Ωρών) --- */
.oa-time-slot {
  background: #fff;
  border: 1px solid #e2e8f0;
  min-height: 42px;
  font-size: 13px;
  white-space: nowrap;
  min-width: 90px;
  border-radius: 4px;
  position: relative;
  padding: 0; /* padding στο inner link */
}

/* Ελεύθερο Slot */
.oa-time-slot.oa-free {
  cursor: pointer;
}

/* Hover effect στα ελεύθερα κουτάκια */
.oa-time-slot.oa-free:hover {
  background: #4b2a78;
  color: #fff;
  border-color: #4b2a78;
  box-shadow: 0 4px 10px rgba(75, 42, 120, 0.15);
  transition: all 0.15s ease-in-out;
}
.oa-time-slot.oa-free a {
  display: flex !important;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.oa-time-slot.oa-free:hover a {
  color: #fff;
}

/* Παρελθόν */
.oa-time-slot.oa-old {
  background: #d1d5db;
  color: #374151;
  cursor: default;
}

/* Κλεισμένα Slots (Booked / Mine / Ranking) */
.oa-time-slot.oa-booked,
.oa-time-slot.oa-mine,
.oa-time-slot.oa-ranking {
  color: #fff;
  position: relative;
  background: #006838; /* Default booked */
  padding: 0; /* padding στο inner link */
  border-radius: 8px; /* Λίγο πιο στρογγυλεμένα */
  line-height: 1.3;
  min-height: 46px;
}
.oa-time-slot.oa-mine {
  background: #78b521;
}
.oa-time-slot.oa-ranking {
  background: #c62828;
}

/* Wrapper/Link μέσα σε κλεισμένο slot */
.oa-slot-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 6px 10px; /* Εδώ μπαίνει το padding */
}

/* Γραμμές Κειμένου */
.oa-slot-line {
  display: block;
  width: 100%;
  line-height: 1.2;
  white-space: nowrap; /* Αρχικό nowrap */
  overflow: hidden;
  text-overflow: ellipsis;
}
.oa-slot-main {
  font-weight: 700;
}
.oa-slot-partner {
  font-size: 12px;
  opacity: 0.95;
}

/* + (More) badge */
.oa-slot-more {
  position: absolute;
  right: 6px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
  cursor: default;
}


/* =========================
   7. LISTS (Court Grid / Booking List)
========================= */
.courts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.court-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.booking-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.booking-list li {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

.booking-list .note {
  font-size: 12px;
  color: #4b5563;
}

.empty {
  font-size: 13px;
  color: #6b7280;
}


/* =========================
   8. MODALS / POPUPS
========================= */

/* --- Announce Popup (Center) --- */
.announcement-modal,
.oa-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5); /* Ενοποίηση background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.oa-modal-content.announce-popup {
  background: #ffffff;
  border-radius: 16px;
  width: 40%;
  max-width: 600px;
  min-width: 320px;
  padding: 28px 32px 30px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.25);
  position: relative;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.announcement-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px 32px;
  max-width: 480px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  text-align: center;
  position: relative;
}

.announcement-box h2 {
  color: #4b2a78;
  margin-bottom: 10px;
}

.announce-close,
.ann-close {
  position: absolute;
  top: 8px; /* Ενοποίηση θέσης */
  right: 8px; /* Ενοποίηση θέσης */
  background: none;
  border: none;
  font-size: 24px;
  font-weight: 600;
  color: #4b2a78;
  cursor: pointer;
  transition: 0.2s ease;
}

.announce-close { /* Ειδικό στυλ για το μεγάλο popup */
  top: 12px;
  right: 16px;
  font-size: 24px;
}

.announce-close:hover {
  transform: scale(1.2);
}

.announce-title {
  font-size: 20px;
  font-weight: 700;
  color: #4b2a78;
  margin-bottom: 14px;
}

.announce-body {
  font-size: 15px;
  color: #333;
  line-height: 1.6;
}

.announcement-box p {
  line-height: 1.5;
  margin-top: 10px;
}

/* Εφέ εμφάνισης */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}


/* =========================
   9. ADMIN / ΜΕΛΗ (TABLES)
========================= */

/* --- Κοινό Στυλ Πινάκων --- */
.admin-members-table {
  width: 100%;
  border-collapse: collapse;
  /* ΑΦΑΙΡΟΥΜΕ το table-layout: fixed */
}

.admin-members-table th,
.admin-members-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  text-align: center;
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;      /* ✅ δεν σπάει σε 2 γραμμές */
}

/* Κεφαλίδες */
.admin-members-table th {
  background: #f8f8fa;
  font-weight: 700;
  color: #4b2a78;
}

/* Ονοματεπώνυμο αριστερά */
.admin-members-table th:nth-child(1),
.admin-members-table td:nth-child(1) {
  text-align: left;
  padding-left: 16px;
}

/* Badge Ρόλου */
.role-badge {
  display: inline-block;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f3f4f6;
  color: #333;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  min-width: 70px;
}

/* Badge Ενεργού / Ανενεργού */
.status-badge {
  display: inline-block;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  color: #fff;
  font-size: 13px;
}
.status-active { background: #22c55e; }
.status-inactive { background: #ef4444; }

/* --- Ειδικά Tweaks Πίνακα Μελών --- */
.members-table td.name {
  text-align: left;
  font-weight: 600;
}

/* Admin Table Customizations (Χωρίς fixed layout) */
.admin-members-table th:nth-child(1),
.admin-members-table td:nth-child(1) {
  text-align: left;
  padding-left: 16px;
}

.admin-members-table td:nth-child(2) {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* --- Table Responsiveness --- */
@media (max-width: 900px) {
  .members-table th,
  .members-table td,
  .admin-members-table th,
  .admin-members-table td {
    font-size: 13px;
    padding: 8px 6px;
  }
  .members-table td.name {
    font-size: 13px;
  }
}


/* Responsive */
@media (max-width: 900px) {
  .admin-members-table th,
  .admin-members-table td {
    font-size: 13px;
    padding: 8px 6px;
  }
}


.admin-members-table td:nth-child(2) {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-members-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-members-table th,
.admin-members-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;  /* δε σπάει σε δεύτερη γραμμή */
}

.admin-members-table th {
  background: #f8f8fa;
  font-weight: 700;
  color: #4b2a78;
}

.admin-members-table th:first-child,
.admin-members-table td:first-child {
  text-align: left;
  white-space: nowrap;
}

.role-badge {
  display: inline-block;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f3f4f6;
  font-size: 13px;
  min-width: 70px;
  text-align: center;
}

.status-badge {
  display: inline-block;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  color: #fff;
  font-size: 13px;
}

.status-active { background: #22c55e; }
.status-inactive { background: #ef4444; }

.form-buttons {
  display: flex;
  gap: 10px;
}

.form-buttons .btn-cancel {
  flex: 0.4; /* πιο στενό */
  min-width: 100px;
}

.form-buttons .btn-submit {
  flex: 0.6; /* πιο φαρδύ */
}

.form-buttons button {
  padding: 14px 0;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
}
