/* ============================================================
   Deporwin Schedule Widget — deporwin-schedule.css
   Responsive weekly timetable grid for WordPress
   ============================================================ */

/* --- Custom properties ------------------------------------ */
.dw-schedule-wrap {
    --dw-bg:           #ffffff;
    --dw-surface:      #f7f8fa;
    --dw-border:       #e8eaed;
    --dw-text:         #1a1d23;
    --dw-text-muted:   #6b7280;
    --dw-accent:       #21bdf0;
    --dw-accent-light: #eff6ff;
    --dw-today-bg:     #fffbeb;
    --dw-today-border: #f59e0b;
    --dw-today-label:  #d97706;
    --dw-radius:       10px;
    --dw-radius-sm:    6px;
    --dw-shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --dw-shadow-lg:    0 4px 16px rgba(0,0,0,.10);
    --dw-font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --dw-col-time:     64px;
    --dw-col-day:      minmax(120px, 1fr);
    --dw-cell-height:  56px;

    font-family: var(--dw-font);
    font-size: 14px;
    color: var(--dw-text);
    background: var(--dw-bg);
    border: 1px solid var(--dw-border);
    border-radius: var(--dw-radius);
    overflow: hidden;
    box-shadow: var(--dw-shadow);
}

/* --- Center selector bar ---------------------------------- */
.dw-center-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--dw-border);
    background: var(--dw-surface);
}

.dw-center-btn {
    padding: 6px 14px;
    border: 1px solid var(--dw-border);
    border-radius: 20px;
    background: var(--dw-bg);
    color: var(--dw-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
    line-height: 1.4;
}
.dw-center-btn:hover:not(.dw-center-btn--active) {
    background: var(--dw-accent-light);
    border-color: var(--dw-accent);
    color: var(--dw-accent);
}
.dw-center-btn--active {
    background: var(--dw-accent);
    border-color: var(--dw-accent);
    color: #fff;
    font-weight: 600;
}
.dw-center-btn:focus-visible {
    outline: 2px solid var(--dw-accent);
    outline-offset: 2px;
}

/* --- Toolbar ---------------------------------------------- */
.dw-schedule-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--dw-border);
    background: var(--dw-bg);
    gap: 8px;
}

.dw-week-label {
    flex: 1;
    text-align: center;
}

.dw-week-range {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--dw-text);
}

.dw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--dw-border);
    border-radius: var(--dw-radius-sm);
    background: var(--dw-bg);
    color: var(--dw-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
    line-height: 1;
}
.dw-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.dw-btn:hover:not(:disabled) {
    background: var(--dw-surface);
    border-color: #c8cbd0;
}
.dw-btn:disabled {
    opacity: .38;
    cursor: not-allowed;
}
.dw-btn:focus-visible {
    outline: 2px solid var(--dw-accent);
    outline-offset: 2px;
}

/* --- Navigation label variants ---------------------------- */
/* Desktop: show week labels; Mobile: show day labels */
.dw-nav-label--day { display: none; }

/* --- Loading state ---------------------------------------- */
.dw-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 16px;
    color: var(--dw-text-muted);
    font-size: 14px;
}

.dw-spinner {
    width: 24px;
    height: 24px;
    animation: dw-spin 0.9s linear infinite;
}
.dw-spinner circle {
    stroke: var(--dw-accent);
    stroke-linecap: round;
    stroke-dasharray: 80 150;
    stroke-dashoffset: 0;
}
@keyframes dw-spin {
    to { transform: rotate(360deg); }
}

/* --- Error state ------------------------------------------ */
.dw-error-msg {
    padding: 24px 16px;
    text-align: center;
    color: #dc2626;
    font-size: 14px;
}

/* ============================================================
   DESKTOP GRID VIEW (≥ 640 px)
   ============================================================ */
.dw-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dw-grid {
    display: grid;
    /* time-column + 7 day columns */
    grid-template-columns: var(--dw-col-time) repeat(7, var(--dw-col-day));
    min-width: 640px;
}

/* --- Day header row --------------------------------------- */
.dw-grid-header {
    display: contents;
}

.dw-grid-header-cell {
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--dw-text-muted);
    background: var(--dw-surface);
    border-bottom: 1px solid var(--dw-border);
    border-right: 1px solid var(--dw-border);
    position: sticky;
    top: 0;
    z-index: 2;
}
.dw-grid-header-cell:first-child {
    border-right: 2px solid var(--dw-border);
}

.dw-grid-header-cell .dw-day-num {
    display: block;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--dw-text);
    margin-top: 2px;
}
.dw-grid-header-cell.dw-today-col {
    background: var(--dw-today-bg);
    border-bottom: 2px solid var(--dw-today-border);
    color: var(--dw-today-label);
}
.dw-grid-header-cell.dw-today-col .dw-day-num {
    color: var(--dw-today-label);
}
.dw-grid-header-cell.dw-today-col .dw-today-pill {
    display: inline-block;
    background: var(--dw-today-border);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 20px;
    margin-top: 3px;
}
.dw-today-pill { display: none; }

/* --- Time rows -------------------------------------------- */
.dw-grid-body {
    display: contents;
}

/*
 * Each row spans all 8 columns and uses subgrid so every cell —
 * including the sticky time label — shares the same auto height.
 * This ensures the label background grows when a day cell has
 * multiple activity cards stacked inside it.
 */
.dw-time-slot {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
}

/* Subgrid fallback for older browsers (Chrome < 117, Firefox < 112) */
@supports not (grid-template-columns: subgrid) {
    .dw-time-slot {
        grid-template-columns: var(--dw-col-time) repeat(7, var(--dw-col-day));
    }
}

.dw-time-label {
    padding: 8px 8px 0;
    min-height: var(--dw-cell-height);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    font-size: 11px;
    font-weight: 600;
    color: var(--dw-text-muted);
    border-right: 2px solid var(--dw-border);
    border-bottom: 1px solid var(--dw-border);
    background: var(--dw-surface);
    position: sticky;
    left: 0;
    z-index: 1;
}

.dw-day-cell {
    border-right: 1px solid var(--dw-border);
    border-bottom: 1px solid var(--dw-border);
    min-height: var(--dw-cell-height);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--dw-bg);
}
.dw-day-cell.dw-today-col {
    background: var(--dw-today-bg);
}
.dw-day-cell:last-child {
    border-right: none;
}
.dw-time-slot:last-child .dw-time-label,
.dw-time-slot:last-child .dw-day-cell {
    border-bottom: none;
}

/* --- Activity card ---------------------------------------- */
.dw-class-card {
    border-radius: var(--dw-radius-sm);
    padding: 5px 7px;
    font-size: 11px;
    line-height: 1.3;
    cursor: default;
    transition: transform .12s, box-shadow .12s;
    border-left: 3px solid transparent;
    overflow: hidden;
    position: relative;
}
.dw-class-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--dw-shadow-lg);
    z-index: 5;
}
.dw-class-name {
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.dw-class-meta {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.dw-class-time-str,
.dw-class-room,
.dw-class-dur {
    font-size: 10px;
    opacity: .75;
}
.dw-class-booking {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(0,0,0,.12);
    margin-top: 2px;
}

/* --- Empty day -------------------------------------------- */
.dw-empty-cell {
    text-align: center;
    padding: 12px 4px;
    font-size: 11px;
    color: var(--dw-border);
}

/* ============================================================
   MOBILE VIEW (< 640 px) — single day strip
   ============================================================ */
@media (max-width: 639px) {

    /* Swap nav label text */
    .dw-nav-label--week { display: none; }
    .dw-nav-label--day  { display: inline; }

    .dw-grid { display: none; }
    .dw-grid-wrap { display: none; }

    .dw-mobile-view {
        display: block;
    }

    /* Day selector pill strip */
    .dw-day-strip {
        display: flex;
        overflow-x: auto;
        gap: 6px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--dw-border);
        background: var(--dw-surface);
        scrollbar-width: none;
    }
    .dw-day-strip::-webkit-scrollbar { display: none; }

    .dw-day-pill {
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 7px 12px;
        border-radius: 20px;
        border: 1px solid var(--dw-border);
        background: var(--dw-bg);
        cursor: pointer;
        font-size: 11px;
        font-weight: 600;
        color: var(--dw-text-muted);
        transition: background .15s, border-color .15s, color .15s;
    }
    .dw-day-pill .pill-num {
        font-size: 15px;
        font-weight: 700;
        color: var(--dw-text);
        line-height: 1;
    }
    .dw-day-pill:hover {
        background: var(--dw-accent-light);
        border-color: var(--dw-accent);
        color: var(--dw-accent);
    }
    .dw-day-pill:hover .pill-num { color: var(--dw-accent); }

    .dw-day-pill.dw-pill-active {
        background: var(--dw-accent);
        border-color: var(--dw-accent);
        color: #fff;
    }
    .dw-day-pill.dw-pill-active .pill-num { color: #fff; }

    .dw-day-pill.dw-pill-today {
        border-color: var(--dw-today-border);
    }
    .dw-day-pill.dw-pill-today .pill-num { color: var(--dw-today-label); }
    .dw-day-pill.dw-pill-active.dw-pill-today {
        background: var(--dw-today-border);
        border-color: var(--dw-today-border);
    }
    .dw-day-pill.dw-pill-active.dw-pill-today .pill-num { color: #fff; }

    /* Mobile day classes list */
    .dw-mobile-day-classes {
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .dw-mobile-class-card {
        display: flex;
        gap: 12px;
        align-items: flex-start;
        padding: 10px 12px;
        border-radius: var(--dw-radius-sm);
        border-left: 4px solid var(--dw-accent);
        background: var(--dw-surface);
        box-shadow: var(--dw-shadow);
    }

    .dw-mobile-time {
        font-size: 13px;
        font-weight: 700;
        color: var(--dw-text);
        min-width: 42px;
        flex-shrink: 0;
        padding-top: 1px;
    }

    .dw-mobile-info {
        flex: 1;
        min-width: 0;
    }
    .dw-mobile-name {
        font-weight: 700;
        font-size: 14px;
        color: var(--dw-text);
    }
    .dw-mobile-sub {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.8);
        margin-top: 2px;
    }
    .dw-mobile-booking {
        display: inline-block;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .3px;
        text-transform: uppercase;
        padding: 2px 6px;
        border-radius: 4px;
        background: var(--dw-accent);
        color: #fff;
        margin-top: 4px;
    }

    .dw-mobile-empty {
        text-align: center;
        padding: 32px 16px;
        color: var(--dw-text-muted);
        font-size: 14px;
    }
}

/* Hide mobile view on desktop */
@media (min-width: 640px) {
    .dw-mobile-view { display: none; }
}

/*** ============================================================
   THEME OVERRIDES (optional)
   ============================================================ */

   .dw-schedule-wrap{
    border: none;
    box-shadow: none;
    border-radius: 0;
   }
.dw-time-label{
    color: #000;
  font-size: 22px;
  line-height: 1;
  font-family: "Barlow Condensed", sans-serif;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0;
  border-right: 0px;
  background: transparent;
}

.dw-grid-header-cell .dw-day-num{
    font-size: 40px;
  line-height: 1;
  font-family: "Barlow Condensed", sans-serif;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0;
}

.dw-day-cell{
    border-right: 0px;
}

.dw-center-bar{
    background: transparent;
    border: none;
    padding: 0 16px;
}

.dw-center-btn--active{
    background-color: black;
}

.dw-day-cell{
    background: transparent;

}

.dw-schedule-toolbar{
    background: transparent;
}

.dw-center-btn--active {
    border-color: black;
}

.dw-grid-header-cell:first-child{
    background: transparent;
}

.dw-grid-header-cell:first-child{
    border-right: 0px;
}

.dw-schedule-toolbar{
    border-bottom: 0px;
}

.dw-grid-header-cell{
    background: transparent;
    border-right: 0px;
}


.dw-schedule-wrap{
    background: transparent;
}

.dw-class-booking{
    display:none;
}

.dw-class-meta{
    justify-content: center;
        font-size: 11px;
}

.dw-class-name{
    font-size: 13px;
}

.dw-class-time-str{
    display:none;
}
.dw-class-room,.dw-class-dur{
  font-size: 11px;
}