/* ===================================================
   🎯 TIMLI FRONTEND - RAZPORED TRENINGOV
   Sa Modal Popup za informacije
   Responsive dizajn: 320px - 1440px
=================================================== */

.timli-frontend-razpored {
  background: transparent;
  padding: 0;
  border-radius: 0;
  max-width: 1440px;
  margin: 0 auto;
  font-family: inherit;
}

.timli-frontend-razpored h2 {
  display: none;
}

/* ===================================================
   🏟️ IGRIŠČE SEKCIJA
=================================================== */

.timli-igrisce-tabela {
  margin-bottom: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--primary-l-4, #e5e7eb);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* ===================================================
   📋 HEADING WRAPPER - INFO IKONE
=================================================== */

.igrisce-heading-wrapper {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
}

.heading-content {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 1;
}

.heading-content h3 {
    margin: 0;
    color: white;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 600;
}

.igrisce-info-modal-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.igrisce-info-modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.igrisce-info-modal-btn img {
    width: 20px;
    height: 20px;
    display: block;
}

/* ===================================================
   🎫 CAPACITY BADGE
=================================================== */

.capacity-badge {
  background: white;
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
  display: inline-block;
  white-space: nowrap;
}

/* ===================================================
   📋 TABELA - RESPONSIVE
=================================================== */

.tabela-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: white;
}

.timli-igrisce-tabela table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.timli-igrisce-tabela th,
.timli-igrisce-tabela td {
  border: 1px solid var(--primary-l-4, #e5e7eb);
  padding: clamp(6px, 1vw, 12px);
  text-align: center;
  font-size: var(--text-s, 0.875rem);
  color: #1f2937;
}

.timli-igrisce-tabela th {
  background: var(--primary-l-4, #f3f4f6);
  font-weight: 600;
  color: #374151;
  position: sticky;
  top: 0;
  z-index: 10;
}

.termin-col {
  background: var(--primary-l-4, #f9fafb);
  font-weight: 600;
  color: #111827;
  min-width: clamp(60px, 12vw, 90px);
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 5;
  white-space: nowrap;
}

/* ===================================================
   🎫 BLOK TRENINGA
=================================================== */

.trening-celica {
  background: var(--primary, #2563eb);
  color: white;
  padding: 1px 4px;
  border-radius: 6px;
  font-weight: 500;
  font-size: var(--text-s, 0.875rem);
  margin: 2px 2px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  text-align: center;
  display: inline-block;
  min-width: 70px;
  transition: all 0.2s ease;
}

.trening-celica:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.prazna-celica {
  color: var(--primary-l-3, #d1d5db);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  font-weight: 300;
}

/* ===================================================
   🪟 MODAL POPUP
=================================================== */

.timli-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.timli-modal-content {
  background: white;
  border-radius: 12px;
  padding: 0;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s ease-in-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.timli-modal-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px 12px 0 0;
  max-height: 400px;
  object-fit: cover;
}

.timli-modal-text {
  padding: 24px 20px;
}

.timli-modal-text h4 {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  color: var(--primary, #2563eb);
  font-weight: 600;
}

.timli-modal-text p {
  margin: 0;
  color: #1f2937;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* INFO POLJA U MODALU */
.timli-modal-info {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.95rem;
}

.info-label {
  font-weight: 600;
  color: var(--primary, #2563eb);
  min-width: 100px;
}

.info-value {
  color: #1f2937;
  font-weight: 500;
}

.timli-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 100;
  padding: 0;
}

.timli-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* ===================================================
   📱 RESPONSIVE - TABLET (768px do 1024px)
=================================================== */

@media (max-width: 1024px) {
  .igrisce-heading-wrapper {
    padding: 11px 14px;
  }

  .heading-content h3 {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  }

  .timli-igrisce-tabela {
    margin-bottom: 40px;
  }

  .timli-igrisce-tabela th,
  .timli-igrisce-tabela td {
    padding: clamp(6px, 0.8vw, 10px);
    font-size: var(--text-s, 0.75rem);
  }

  .termin-col {
    min-width: clamp(55px, 10vw, 75px);
  }

  .trening-celica {
    padding: 1px 3px;
    font-size: var(--text-s, 0.75rem);
    min-width: 55px;
    margin: 2px 1px;
  }

  .capacity-badge {
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  .timli-igrisce-tabela table {
    min-width: 600px;
  }

  .timli-modal-content {
    max-width: 90%;
  }

  .timli-modal-image {
    max-height: 300px;
  }

  .timli-modal-text {
    padding: 16px;
  }

  .timli-modal-text h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  .timli-modal-text p {
    font-size: 0.9rem;
  }

  .info-row {
    font-size: 0.9rem;
    padding: 6px 0;
  }

  .info-label {
    min-width: 90px;
  }
}

/* ===================================================
   📱 RESPONSIVE - MOBILNI (320px do 768px)
=================================================== */

@media (max-width: 768px) {
  .igrisce-heading-wrapper {
    padding: 10px 12px;
  }

  .heading-content h3 {
    font-size: clamp(0.85rem, 1.5vw, 1rem);
  }

  .timli-igrisce-tabela {
    margin-bottom: 40px;
  }

  .timli-igrisce-tabela th,
  .timli-igrisce-tabela td {
    padding: clamp(6px, 0.8vw, 10px);
    font-size: var(--text-s, 0.75rem);
  }

  .termin-col {
    min-width: clamp(55px, 10vw, 75px);
  }

  .trening-celica {
    padding: 1px 3px;
    font-size: var(--text-s, 0.75rem);
    min-width: 55px;
    margin: 2px 1px;
  }

  .trening-celica:hover {
    transform: none;
  }

  .capacity-badge {
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  .timli-igrisce-tabela table {
    min-width: 600px;
  }

  .timli-modal {
    padding: 12px;
  }

  .timli-modal-content {
    max-width: 100%;
  }

  .timli-modal-image {
    max-height: 250px;
  }

  .timli-modal-text {
    padding: 16px;
  }

  .timli-modal-text h4 {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .timli-modal-text p {
    font-size: 0.875rem;
  }

  .info-row {
    font-size: 0.875rem;
    padding: 6px 0;
  }

  .info-label {
    min-width: 80px;
  }

  .timli-modal-close {
    width: 32px;
    height: 32px;
    font-size: 24px;
    top: 8px;
    right: 8px;
  }
}

/* ===================================================
   📱 RESPONSIVE - MALI MOBILNI (320px do 480px)
=================================================== */

@media (max-width: 480px) {
  .igrisce-heading-wrapper {
    padding: 9px 10px;
    gap: 6px;
  }

  .heading-content h3 {
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  }

  .igrisce-info-modal-btn {
    width: 24px;
    height: 24px;
  }

  .igrisce-info-modal-btn img {
    width: 16px;
    height: 16px;
  }

  .timli-igrisce-tabela {
    margin-bottom: 30px;
  }

  .timli-igrisce-tabela th,
  .timli-igrisce-tabela td {
    padding: clamp(5px, 0.7vw, 8px);
    font-size: var(--text-s, 0.7rem);
  }

  .termin-col {
    min-width: clamp(50px, 9vw, 65px);
  }

  .trening-celica {
    padding: 1px 2px;
    font-size: var(--text-s, 0.7rem);
    min-width: 45px;
    margin: 1px 1px;
  }

  .capacity-badge {
    padding: 2px 6px;
    font-size: 0.65rem;
  }

  .timli-modal-image {
    max-height: 200px;
  }

  .timli-modal-text {
    padding: 12px;
  }

  .timli-modal-text h4 {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .timli-modal-text p {
    font-size: 0.8rem;
  }

  .info-row {
    font-size: 0.8rem;
    padding: 4px 0;
  }

  .info-label {
    min-width: 70px;
  }
}

/* ===================================================
   💻 DESKTOP - 1024px do 1440px
=================================================== */

@media (min-width: 1024px) {
  .igrisce-heading-wrapper {
    padding: 14px 18px;
  }

  .heading-content h3 {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
  }

  .timli-igrisce-tabela {
    margin-bottom: 80px;
  }

  .timli-igrisce-tabela th,
  .timli-igrisce-tabela td {
    padding: clamp(10px, 1.2vw, 14px);
    font-size: var(--text-s, 0.875rem);
  }

  .termin-col {
    min-width: 100px;
  }

  .trening-celica {
    padding: 1px 4px;
    font-size: var(--text-s, 0.875rem);
    min-width: 80px;
    margin: 2px 2px;
  }

  .capacity-badge {
    padding: 4px 10px;
    font-size: var(--text-s, 0.875rem);
  }

  .timli-modal-content {
    max-width: 600px;
  }

  .timli-modal-image {
    max-height: 400px;
  }

  .timli-modal-text {
    padding: 24px 20px;
  }

  .timli-modal-text h4 {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }

  .timli-modal-text p {
    font-size: 0.95rem;
  }

  .info-row {
    font-size: 0.95rem;
  }

  .info-label {
    min-width: 100px;
  }
}

/* ===================================================
   🎨 DARK MODE
=================================================== */

@media (prefers-color-scheme: dark) {
  .timli-igrisce-tabela {
    background: #1f2937;
    border-color: var(--primary-l-2, #374151);
  }

  .igrisce-heading-wrapper {
    background: var(--primary);
    color: #ffffff;
  }

  .timli-igrisce-tabela th {
    background: var(--primary-l-3, #374151);
    color: #f3f4f6;
  }

  .timli-igrisce-tabela th,
  .timli-igrisce-tabela td {
    border-color: var(--primary-l-2, #4b5563);
    color: #f3f4f6;
  }

  .termin-col {
    background: var(--primary-l-3, #1f2937);
  }

  .prazna-celica {
    color: var(--primary-l-1, #6b7280);
  }

  .timli-modal-content {
    background: #1f2937;
    color: #f3f4f6;
  }

  .timli-modal-text h4 {
    color: #60a5fa;
  }

  .timli-modal-text p {
    color: #e5e7eb;
  }

  .info-label {
    color: #60a5fa;
  }

  .info-value {
    color: #e5e7eb;
  }

  .timli-modal-info {
    border-top-color: #374151;
  }
}

/* ===================================================
   ✨ ANIMACIJE
=================================================== */

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

.timli-frontend-razpored {
  animation: fadeIn 0.3s ease-in;
}

html {
  scroll-behavior: smooth;
}

/* ===================================================
   📌 ACCESSIBILITY
=================================================== */

.timli-igrisce-tabela a:focus,
.igrisce-info-modal-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media print {
  .timli-frontend-razpored {
    box-shadow: none;
  }

  .timli-igrisce-tabela {
    page-break-inside: avoid;
  }

  .timli-modal {
    display: none !important;
  }
}