/* S5apps Schedule Styles v2.5 - FINAL FIX */
.s5-schedule-wrapper { 
    font-family: 'Inter', sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto; 
    width: 100%; 
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* HEADER */
.s5-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #f0f0f0; background: #fff; }
.s5-week-title { text-align: center; }
.s5-week-num { font-size: 16px; font-weight: 800; color: #1f2937; }
.s5-week-dates { font-size: 13px; color: #6b7280; }
.s5-nav-btn { background: #f3f4f6; border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.s5-nav-btn:hover { background: #e5e7eb; }

/* CLUB SWITCHER */
.s5-club-switcher { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; color: white; }
.s5-club-name { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.s5-switch-btn { background: rgba(255,255,255,0.2); border: none; color: white; border-radius: 4px; padding: 4px 10px; cursor: pointer; }

/* COMMON ELEMENTS */
.s5-time { font-weight: 800; display: block; color: #1e293b; margin-bottom: 2px; font-size: 13px; }
.s5-loc { font-size: 11px; color: #64748b; display: block; margin-bottom: 2px; font-weight: 500;}
.s5-note { 
    font-size: 10px; display: block; width: 100%;
    line-height: 1.3; font-style: italic; color: #475569; 
    padding-top: 2px; border-top: 1px dashed rgba(0,0,0,0.1); margin-top: 2px;
}

/* BUBBLES & COLORS */
.s5-event-bubble { 
    background: #f8fafc; 
    border-radius: 6px; 
    padding: 8px 10px; 
    font-size: 12px; 
    margin-bottom: 6px;
    border: 1px solid #e2e8f0; 
    border-left: 4px solid #cbd5e1; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    position: relative;
}

/* MERGING CLASSES */
.s5-merged-top { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 1px dashed #e2e8f0; margin-bottom: 0; }
.s5-merged-bottom { border-top-left-radius: 0; border-top-right-radius: 0; border-top: none; margin-top: 0; }
.s5-merged-mid { border-radius: 0; border-top: none; border-bottom: 1px dashed #e2e8f0; margin: 0; }

/* SPECIAL COLORS */
.s5-event-yellow { background: #fefce8; border-left-color: #eab308; }
.s5-event-yellow .s5-time { color: #854d0e; }
.s5-event-red { background: #fef2f2; border-left-color: #ef4444; }
.s5-event-red .s5-time { color: #991b1b; }

.s5-mobile-gap { height: 4px; margin: 4px 0 10px 0; border-radius: 2px; opacity: 0.3; }

/* FILTERS */
.s5-filters { padding: 15px; border-bottom: 1px solid #f0f0f0; display: flex; flex-wrap: wrap; gap: 6px; }
.s5-filter-btn { padding: 4px 10px; border: 1px solid #ddd; border-radius: 15px; font-size: 11px; font-weight: 600; cursor: pointer; background: white; }


/* ==========================================================================
   DESKTOP STYLES (SAMO NAD 900px)
   To prepreči, da bi se ti stili vmešavali v mobilni prikaz!
   ========================================================================== */
@media (min-width: 901px) {
    .s5-mobile-view { display: none !important; }
    .s5-desktop-only { display: block !important; }

    /* MATRIX (DESKTOP) */
    .s5-table-container { overflow-x: auto; }
    .s5-table { width: 100%; border-collapse: collapse; min-width: 900px; table-layout: fixed; }
    .s5-table th { background: #f9fafb; padding: 10px 5px; text-align: center; border-bottom: 2px solid #e5e7eb; border-right: 1px solid #f1f5f9; font-size: 11px; text-transform: uppercase; color: #64748b; }
    .s5-table td { border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; padding: 8px; vertical-align: top; height: 80px; }
    .s5-table th:first-child, .s5-table td:first-child { 
        position: sticky; left: 0; background: #fff; z-index: 10; 
        border-right: 2px solid #e5e7eb; width: 110px; font-weight: 700; font-size: 13px; color: #1e293b;
        box-shadow: 2px 0 5px rgba(0,0,0,0.05); padding-left: 15px; vertical-align: middle;
    }
    .s5-table th:first-child { background: #f9fafb; }

    /* DAY COLUMNS (DESKTOP) - Premaknjeno sem noter! */
    .s5-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; border-top: 1px solid #e5e7eb; overflow-x: auto; min-width: 1000px; }
    .s5-day-col { border-right: 1px solid #e5e7eb; min-height: 300px; background: #fff; display: flex; flex-direction: column; }
    .s5-day-col:last-child { border-right: none; }
    .s5-day-header { padding: 12px 5px; text-align: center; border-bottom: 1px solid #e5e7eb; background: #f9fafb; font-weight: 700; font-size: 12px; text-transform: uppercase; color: #475569; }
    .s5-day-body { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
}

/* ==========================================================================
   MOBILE PORTRAIT (DEFAULT < 900px)
   ========================================================================== */
@media (max-width: 900px) {
    .s5-desktop-only { display: none !important; }
    .s5-mobile-view { display: block; padding: 10px; }

    .s5-acc-item { margin-bottom: 12px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; overflow: hidden; }
    .s5-acc-header { padding: 12px 15px; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; background: #f9fafb; border-bottom: 1px solid #f1f5f9; }
    .s5-acc-body { padding: 10px; background: #fff; display: none; } 
    .s5-acc-header.active { background: #fff; border-bottom: 2px solid #e5e7eb; }
    .s5-acc-header.active + .s5-acc-body { display: block; }

    .s5-m-event { padding: 10px 0; border-bottom: 1px solid #f1f5f9; display: flex; gap: 15px; align-items: center; }
    .s5-m-event:last-child { border-bottom: none; }
    .s5-m-date { font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; width: 60px; text-align: right; line-height: 1.2; }
    .s5-m-content { flex: 1; }
}

/* ==========================================================================
   MOBILE LANDSCAPE (Horizontalni telefon)
   Tu povozimo zgornje nastavitve in uporabimo tvojo 690px rešitev!
   ========================================================================== */
@media (max-width: 900px) and (orientation: landscape) {
    /* 1. Pokaži desktop view (ki je sicer skrit zgoraj) */
    .s5-mobile-view { display: none !important; }
    .s5-desktop-only { display: block !important; }

    /* 2. FIX ZA TABELO (Matrix) */
    .s5-table-container {
        display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    .s5-table { min-width: 1000px; }

    /* 3. FIX ZA DNEVE (Day View) - TVOJA REŠITEV 690px */
    .s5-week-grid {
        display: flex !important;       /* FLEX namesto GRID */
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        
        overflow-x: auto; 
        width: 100%;
        
        /* Ključno: Uporabimo tvojo širino */
        min-width: 660px !important; 
        border-top: 1px solid #e5e7eb;
    }

    /* Stolpci */
    .s5-day-col {
        flex: 1; 
        min-width: 0;
        display: block;
        border-right: 1px solid #e5e7eb;
        background: #fff;
    }
    .s5-day-col:last-child { border-right: none; }

    /* Pomanjšave */
    .s5-day-header {
        font-size: 10px; 
        padding: 6px 2px;
        text-align: center;
        background: #f9fafb;
        border-bottom: 1px solid #e5e7eb;
        font-weight: 700;
        color: #475569;
        white-space: nowrap;
        overflow: hidden;
    }
    .s5-event-bubble { padding: 3px 4px; font-size: 10px; line-height: 1.1; margin-bottom: 3px; border-left-width: 3px; }
    .s5-time { font-size: 10px; margin-bottom: 1px; }
    .s5-loc { display: none; } 
}