/* ============================================================================
   OSPRO Gym Schedule Widget - Styles
   Dark Premium Theme with Glassmorphism & Animations
   ============================================================================ */

.ospro-schedule {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ospro-schedule * {
  box-sizing: border-box;
}

.os-panel {
  background: linear-gradient(135deg, #080c18 0%, #0a0f1f 100%);
  border-radius: 16px;
  padding: 16px 16px 20px;
  min-height: 0;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(74, 144, 217, 0.15);
  overflow: hidden;
}

/* ============================================================================
   Loading State - Skeleton Loader with Shimmer
   ============================================================================ */

[data-role="loading"] {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.skeleton-pill {
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  animation: shimmer 2s infinite;
}

.skeleton-cards {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.skeleton-card {
  height: 52px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ============================================================================
   Error State
   ============================================================================ */

[data-role="error"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #e74c3c;
  text-align: center;
  gap: 16px;
}

.error-message {
  font-size: 16px;
  font-weight: 500;
}

.error-retry {
  padding: 10px 20px;
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid #e74c3c;
  color: #e74c3c;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.error-retry:hover {
  background: rgba(231, 76, 60, 0.3);
}

/* ============================================================================
   Filter Pills
   ============================================================================ */

.os-filter-container {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.os-filter-pill {
  padding: 8px 16px;
  background: rgba(74, 144, 217, 0.15);
  border: 1px solid rgba(74, 144, 217, 0.3);
  color: #b8d4f1;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.25s ease;
  white-space: nowrap;
  user-select: none;
}

.os-filter-pill:hover {
  background: rgba(74, 144, 217, 0.25);
  border-color: rgba(74, 144, 217, 0.5);
}

.os-filter-pill.active {
  background: #4a90d9;
  border-color: #4a90d9;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(74, 144, 217, 0.4);
}

/* PT pill — złoty styl */
.os-filter-pill--pt {
  background: rgba(242, 194, 0, .12) !important;
  border-color: rgba(242, 194, 0, .3) !important;
  color: #F2C200 !important;
}
.os-filter-pill--pt:hover {
  background: rgba(242, 194, 0, .20) !important;
  border-color: rgba(242, 194, 0, .5) !important;
}
.os-filter-pill--pt.active,
.os-filter-pill--pt.is-active {
  background: rgba(242, 194, 0, .25) !important;
  border-color: rgba(242, 194, 0, .65) !important;
  color: #FFD84A !important;
  box-shadow: 0 0 12px rgba(242, 194, 0, .35) !important;
}

/* ============================================================================
   Desktop Calendar View - 7 Column Grid (Mon-Sun)
   ============================================================================ */

[data-role="days"] {
  display: none;
}

/* Widok mobilny — kontener kolumn dni */
[data-role="days"].mobile-view {
  display: block;
}

[data-role="days"].desktop-view {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.os-day-column {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.os-day-header {
  padding: 8px 4px;
  text-align: center;
  border-bottom: 2px solid rgba(74, 144, 217, 0.2);
  margin-bottom: 4px;
}

.os-day-name {
  font-size: 11px;
  font-weight: 700;
  color: #4a90d9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.os-day-date {
  font-size: 11px;
  font-weight: 600;
  color: #8a9fb0;
  margin-top: 1px;
}

.os-day-empty {
  padding: 16px 8px;
  text-align: center;
  color: #5a6f82;
  font-size: 12px;
  font-style: italic;
}

/* Today highlight -- desktop column header */
.os-today-header {
  border-bottom-color: #4a90d9 !important;
}

.os-today-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 2px solid #4a90d9;
  border-radius: 50%;
  color: #fff !important;
  font-weight: 800 !important;
  background: rgba(74, 144, 217, 0.15);
  margin-top: 2px;
}

/* Today highlight -- mobile tab button */
.os-tab-btn.os-today-tab {
  border: 2px solid #4a90d9 !important;
  color: #fff !important;
}


/* ============================================================================
   Class Cards — compact 2-row, 7-column-friendly
   ============================================================================ */

/* Per-discipline color tokens */
.os-class-card         { --cc: #4a90d9; }
.os-class-card.ninja   { --cc: #4a90d9; }
.os-class-card.ocr     { --cc: #2ecc71; }
.os-class-card.kids    { --cc: #f39c12; }
.os-class-card.cross   { --cc: #9b59b6; }

/* Card — flex-row: [time] + [content 2 rows] */
.os-class-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease;
  animation: cardEnter .4s ease-out both;
  min-height: 58px;
  gap: 0;
}

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

/* Left colored bar */
.os-class-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cc);
  box-shadow: 0 0 8px var(--cc);
  border-radius: 8px 0 0 8px;
  flex-shrink: 0;
}

/* Hover glow */
.os-class-card:hover {
  background: rgba(255,255,255,.07);
  box-shadow: 0 0 14px rgba(74,144,217,.12), 0 2px 8px rgba(0,0,0,.25);
}

.os-class-card.inactive {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Left: godziny (stacked) ────────────────────────────── */
.os-card-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 7px 5px 7px 11px;
  width: 42px;
  min-width: 42px;
  flex-shrink: 0;
  gap: 1px;
}

.os-card-time-s {
  font-size: 11px;
  font-weight: 700;
  color: var(--cc);
  line-height: 1.1;
  white-space: nowrap;
}

.os-card-time-e {
  font-size: 9px;
  color: rgba(255,255,255,.28);
  line-height: 1.1;
  white-space: nowrap;
}

/* ── Mid: tytuł (góra) + meta (dół) ─────────────────────── */
.os-card-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7px 6px 7px 5px;
  min-width: 0;
  gap: 4px;
  border-left: 1px solid rgba(255,255,255,.06);
}

.os-card-title {
  font-size: 11px;
  font-weight: 600;
  color: #e8eef7;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Meta: trener (flex:1, obcina) + odznaki + przycisk */
.os-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.os-card-coach {
  font-size: 9px;
  color: rgba(255,255,255,.38);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Odznaki: widoczne tylko w widoku 1-dniowym (mobile) i szerokim desktop */
.os-card-level {
  display: inline-block;
  font-size: 8px;
  padding: 1px 4px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.4);
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}

.os-card-audience {
  display: inline-block;
  font-size: 8px;
  padding: 1px 4px;
  background: rgba(255,193,7,.10);
  color: #f5a623;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}

/* W 7-kolumnowym desktop: karta pozioma (kompaktowa) — cały tydzień w widoku */

/* Węższy blok czasu */
[data-role="days"].desktop-view .os-card-left {
  width: 34px;
  min-width: 34px;
  padding: 6px 3px 6px 8px;
}

[data-role="days"].desktop-view .os-card-time-s {
  font-size: 10px;
}

[data-role="days"].desktop-view .os-card-time-e {
  font-size: 8px;
}

/* Mniejszy tytuł */
[data-role="days"].desktop-view .os-card-title {
  font-size: 10px;
}

/* Chowamy trener + odznaki — za wąsko */
[data-role="days"].desktop-view .os-card-coach,
[data-role="days"].desktop-view .os-card-level,
[data-role="days"].desktop-view .os-card-audience {
  display: none;
}

/* Kompaktowy przycisk */
[data-role="days"].desktop-view .os-card-signup {
  padding-right: 5px;
}

[data-role="days"].desktop-view .os-signup-btn {
  font-size: 8px;
  padding: 2px 6px;
  letter-spacing: .1px;
}

/* ── Przycisk Zapisz ─────────────────────────────────────── */
.os-card-signup {
  flex-shrink: 0;
  padding-left: 2px;
  padding-right: 7px;
}

.os-signup-btn {
  padding: 3px 8px;
  background: rgba(74,144,217,.15);
  border: 1px solid rgba(74,144,217,.4);
  color: #7ab8f5;
  border-radius: 5px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
  width: auto;
  line-height: 1.5;
}

.os-signup-btn:hover {
  background: #4a90d9;
  color: #fff;
  border-color: #4a90d9;
}

.os-signup-btn.confirmed {
  background: rgba(46,204,113,.15);
  border-color: rgba(46,204,113,.55);
  color: #4ade80;
  cursor: default;
}

.os-signup-btn.confirmed:hover {
  background: rgba(46,204,113,.25);
}

/* ============================================================================
   Confirmation Dialog
   ============================================================================ */

.os-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483647; /* powyżej panelu konta OSPRO */
  animation: fadeIn 0.3s ease-out;
  cursor: default !important; /* kursor widoczny nad tłem overlay */
}

/* Nadpisz cursor: none z motywu/Divi custom cursor — dla całego okna i jego zawartości */
.os-confirm-overlay,
.os-confirm-overlay * {
  cursor: default !important;
}
.os-confirm-overlay .os-confirm-yes,
.os-confirm-overlay .os-confirm-no {
  cursor: pointer !important;
}

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

.os-confirm-dialog {
  background: linear-gradient(135deg, #0f1420 0%, #12182a 100%);
  border: 1px solid rgba(74, 144, 217, 0.3);
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  animation: slideUp 0.3s ease-out;
  text-align: center;
}

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

.os-confirm-title {
  font-size: 16px;
  font-weight: 600;
  color: #e8eef7;
  margin-bottom: 8px;
}

.os-confirm-details {
  font-size: 13px;
  color: #a8b8ca;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* "Dla kogo?" dropdown — widoczny gdy user ma subkonta */
.os-confirm-for {
  margin-bottom: 16px;
  text-align: left;
}
.os-confirm-for-label {
  display: block;
  font-size: 12px;
  color: rgba(200,220,255,.7);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.os-confirm-who {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(74,144,217,.3);
  border-radius: 8px;
  color: #e8eef7;
  font-size: 14px;
  padding: 8px 10px;
  cursor: pointer;
  outline: none;
  appearance: auto;
}
.os-confirm-who:focus {
  border-color: rgba(74,144,217,.7);
}

.os-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.os-confirm-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.25s ease;
  flex: 1;
}

.os-confirm-yes {
  background: #2ecc71;
  color: #ffffff;
}

.os-confirm-yes:hover {
  background: #27ae60;
  transform: scale(1.02);
}

.os-confirm-no {
  background: rgba(74, 144, 217, 0.2);
  color: #4a90d9;
  border: 1px solid #4a90d9;
}

.os-confirm-no:hover {
  background: rgba(74, 144, 217, 0.3);
}

.os-confirm-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ── Regulamin klubu w confirm dialog ── */
.os-confirm-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  font-size: .82rem;
  color: rgba(255,255,255,.75);
  line-height: 1.45;
  cursor: pointer;
  transition: border-color .15s;
}
.os-confirm-terms-label:hover {
  border-color: rgba(106,173,255,.4);
}
.os-confirm-terms-label.os-confirm-terms-err {
  border-color: rgba(224,85,85,.7) !important;
  background: rgba(224,85,85,.07) !important;
  color: rgba(255,140,140,.9) !important;
}
.os-confirm-terms-chk {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: #4a90d9;
  cursor: pointer;
}
.os-confirm-terms-link {
  color: #6aadff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.os-confirm-terms-link:hover { color: #9dc8ff; }
.os-confirm-terms-req {
  color: #e05555;
  font-size: .78rem;
}

/* ============================================================================
   Toast Notification
   ============================================================================ */

.os-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2ecc71;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2147483647;
  animation: slideInRight 0.3s ease-out, slideOutRight 0.3s ease-in 2.7s forwards;
  box-shadow: 0 8px 24px rgba(46, 204, 113, 0.3);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* ============================================================================
   Mobile View - Day Tabs + Single Column
   ============================================================================ */

.os-mobile-tabs {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.os-mobile-tabs.visible {
  display: flex;
}

.os-tab-btn {
  padding: 8px 14px;
  background: rgba(74, 144, 217, 0.15);
  border: 1px solid rgba(74, 144, 217, 0.3);
  color: #b8d4f1;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.os-tab-btn:hover {
  background: rgba(74, 144, 217, 0.25);
}

.os-tab-btn.active {
  background: #4a90d9;
  border-color: #4a90d9;
  color: #ffffff;
}

.os-mobile-column {
  display: none;
}

.os-mobile-column.active {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================================
   Responsive Media Queries
   ============================================================================ */

@media (max-width: 1400px) {
  [data-role="days"].desktop-view {
    gap: 6px;
  }
}

@media (max-width: 1000px) {
  [data-role="days"].desktop-view {
    gap: 5px;
  }

  .os-card-left {
    width: 38px;
    min-width: 38px;
    padding-left: 9px;
  }
}

@media (max-width: 768px) {
  [data-role="days"].desktop-view {
    display: none;
  }
  
  .os-mobile-tabs.visible {
    display: flex;
  }
  
  .os-mobile-column.active {
    display: flex;
  }
}

@media (max-width: 620px) {
  /* Mobile-first: Hide desktop 7-column, show day tabs */
  [data-role="days"].desktop-view {
    display: none !important;
  }
  
  .os-mobile-tabs {
    display: none;
  }
  
  .os-mobile-tabs.visible {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }
  
  .os-tab-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  .os-panel {
    padding: 16px;
  }
  
  .os-filter-container {
    gap: 6px;
  }
  
  .os-filter-pill {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .os-class-card {
    min-height: 46px;
  }

  .os-card-title {
    font-size: 11px;
  }

  .os-card-time-s {
    font-size: 11px;
  }
  
  .os-confirm-dialog {
    max-width: 90%;
    margin: 0 20px;
  }
  
  .os-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: calc(100% - 32px);
  }
}

@media (max-width: 480px) {
  .os-panel {
    padding: 12px;
    min-height: auto;
  }
  
  .os-filter-pill {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .os-class-card {
    min-height: 42px;
  }

  .os-card-title {
    font-size: 11px;
  }

  .os-card-coach {
    font-size: 9px;
  }

  .os-card-left {
    min-width: 40px;
    padding-left: 11px;
  }

  .os-card-signup {
    padding-right: 7px;
  }

  .os-signup-btn {
    font-size: 9px;
    padding: 3px 8px;
  }
  
  .os-tab-btn {
    padding: 5px 10px;
    font-size: 10px;
  }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.os-hidden {
  display: none !important;
}

.os-loading {
  opacity: 0.6;
  pointer-events: none;
}

.os-text-center {
  text-align: center;
}

.os-mt-16 {
  margin-top: 16px;
}

.os-mb-16 {
  margin-bottom: 16px;
}

/* ============================================================================
   Scrollbar Styling
   ============================================================================ */

.os-mobile-tabs::-webkit-scrollbar {
  height: 6px;
}

.os-mobile-tabs::-webkit-scrollbar-track {
  background: rgba(74, 144, 217, 0.08);
  border-radius: 3px;
}

.os-mobile-tabs::-webkit-scrollbar-thumb {
  background: rgba(74, 144, 217, 0.25);
  border-radius: 3px;
}

.os-mobile-tabs::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 144, 217, 0.4);
}

/* ============================================================================
   Navigation Bar (Week Prev/Next)
   ============================================================================ */

.os-nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.os-nav-arrow {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.6);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all .15s;
  flex-shrink: 0;
  font-family: inherit;
}
.os-nav-arrow:hover {
  background: rgba(74,144,217,.15);
  border-color: rgba(74,144,217,.4);
  color: #7ab8f5;
}

.os-week-label {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  letter-spacing: .3px;
  min-width: 140px;
}

.os-today-btn {
  width: auto !important;
  padding: 0 14px !important;
  border-radius: 50px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .4px !important;
  text-transform: uppercase !important;
  background: rgba(74,144,217,.12) !important;
  border-color: rgba(74,144,217,.3) !important;
  color: #7ab8f5 !important;
}

@media (max-width: 620px) {
  .os-nav-bar { gap: 6px; }
  .os-week-label { font-size: 11px; min-width: 110px; }
}

/* ── Licznik miejsc ── */
.os-spots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  margin-top: 2px;
}
.os-spots-dot-circle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.os-spots-free {
  color: #3cd880;
}
.os-spots-free .os-spots-dot-circle {
  background: #3cd880;
  box-shadow: 0 0 5px rgba(60,216,128,.6);
}
.os-spots-full {
  color: #e05252;
}
.os-spots-full .os-spots-dot-circle {
  background: #e05252;
  box-shadow: 0 0 5px rgba(224,82,82,.5);
}

/* ── Przycisk i karta gdy brak miejsc ── */
.os-signup-btn.is-full {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: rgba(255,255,255,.35) !important;
  cursor: not-allowed !important;
}
.os-class-card.is-full-card {
  opacity: .65;
}
