/* Omsorgsschema Teacher View — feature-specific styles */

/* ============================================
   PAGE TITLE
   ============================================ */
.page-title {
    font-size: 1.375rem;
    font-weight: 500;
    margin: 0 0 20px 0;
    color: var(--gray-darker, #333);
}

/* ============================================
   DEPARTMENT SELECTOR
   ============================================ */
.department-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.department-selector__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-dark, #666);
    white-space: nowrap;
}

.department-selector__control {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.department-selector__select {
    appearance: none;
    background: var(--white, #fff);
    border: 1px solid var(--gray-light, #ddd);
    border-radius: 6px;
    padding: 8px 36px 8px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--gray-darker, #333);
    cursor: pointer;
    min-width: 200px;
}

.department-selector__select:focus {
    outline: 2px solid var(--cl-hard, #26418f);
    outline-offset: 1px;
    border-color: var(--cl-hard, #26418f);
}

.department-selector__icon {
    position: absolute;
    right: 8px;
    pointer-events: none;
    color: var(--gray, #999);
    font-size: 20px;
}

/* ============================================
   WEEK NAVIGATION
   ============================================ */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--white, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
}

.week-nav__controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.week-nav__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-light, #ddd);
    border-radius: 50%;
    background: var(--white, #fff);
    color: var(--gray-darker, #333);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.week-nav__arrow:hover {
    background: var(--gray-lightest, #f5f5f5);
    border-color: var(--gray, #999);
}

.week-nav__arrow:focus-visible {
    outline: 2px solid var(--cl-hard, #26418f);
    outline-offset: 2px;
}

.week-nav__label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-darker, #333);
    min-width: 130px;
    text-align: center;
}

.week-nav__today {
    padding: 6px 16px;
    border: 1px solid var(--cl-hard, #26418f);
    border-radius: 4px;
    background: transparent;
    color: var(--cl-hard, #26418f);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.week-nav__today:hover {
    background: var(--cl-hard, #26418f);
    color: var(--white, #fff);
}

.week-nav__today:focus-visible {
    outline: 2px solid var(--cl-hard, #26418f);
    outline-offset: 2px;
}

.week-nav__date-range {
    font-size: 0.8125rem;
    color: var(--gray, #999);
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ============================================
   DAY FILTER
   ============================================ */
.day-filter {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.day-filter__btn {
    padding: 6px 14px;
    border: 1px solid var(--gray-light, #ddd);
    border-radius: 20px;
    background: var(--white, #fff);
    color: var(--gray-dark, #666);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
}

.day-filter__btn:hover {
    border-color: var(--cl-hard, #26418f);
    color: var(--cl-hard, #26418f);
}

.day-filter__btn--active {
    background: var(--cl-hard, #26418f);
    border-color: var(--cl-hard, #26418f);
    color: var(--white, #fff);
}

.day-filter__btn:focus-visible {
    outline: 2px solid var(--cl-hard, #26418f);
    outline-offset: 2px;
}

/* ============================================
   STATUS FILTER
   ============================================ */
.status-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-filter__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-dark, #666);
    white-space: nowrap;
}

.status-filter__select {
    appearance: none;
    background: var(--white, #fff);
    border: 1px solid var(--gray-light, #ddd);
    border-radius: 6px;
    padding: 6px 32px 6px 12px;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--gray-darker, #333);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.status-filter__select:focus {
    outline: 2px solid var(--cl-hard, #26418f);
    outline-offset: 1px;
    border-color: var(--cl-hard, #26418f);
}

/* ============================================
   SUMMARY CARDS
   ============================================ */
.summary-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.summary-cards__card {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white, #fff);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--gray-light, #ddd);
}

.summary-cards__card--present {
    border-left-color: var(--cl-green, #4caf50);
}

.summary-cards__card--sick {
    border-left-color: var(--cl-red, #f44336);
}

.summary-cards__card--off {
    border-left-color: var(--gray, #999);
}

.summary-cards__icon {
    font-size: 28px;
    color: var(--gray, #999);
}

.summary-cards__card--present .summary-cards__icon {
    color: var(--cl-green, #4caf50);
}

.summary-cards__card--sick .summary-cards__icon {
    color: var(--cl-red, #f44336);
}

.summary-cards__card--off .summary-cards__icon {
    color: var(--gray, #999);
}

.summary-cards__content {
    display: flex;
    flex-direction: column;
}

.summary-cards__count {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--gray-darker, #333);
}

.summary-cards__label {
    font-size: 0.75rem;
    color: var(--gray, #999);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================
   OVERVIEW TABLE
   ============================================ */
.overview-table-wrapper {
    background: var(--white, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

.overview-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.overview-table__th {
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--gray-dark, #666);
    background: var(--gray-lightest, #fafafa);
    border-bottom: 2px solid var(--gray-light, #eee);
    text-align: left;
    white-space: nowrap;
}

.overview-table__th--child {
    min-width: 180px;
}

.overview-table__th--today {
    background: rgba(38, 65, 143, 0.06);
    color: var(--cl-hard, #26418f);
    border-bottom-color: var(--cl-hard, #26418f);
}

.overview-table__row {
    cursor: pointer;
    transition: background 0.12s;
}

.overview-table__row:hover {
    background: var(--gray-lightest, #f5f5f5);
}

.overview-table__row:focus-visible {
    outline: 2px solid var(--cl-hard, #26418f);
    outline-offset: -2px;
}

.overview-table__td {
    padding: 12px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-light, #eee);
    vertical-align: middle;
}

.overview-table__td--child {
    font-weight: 500;
    color: var(--gray-darker, #333);
}

/* Today column highlight */
.overview-table__td[data-day="thu"] {
    background: rgba(38, 65, 143, 0.03);
}

/* ============================================
   CHILD INFO (table name cell)
   ============================================ */
.child-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.child-info__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--gray-light, #ddd);
}

.child-info__name {
    white-space: nowrap;
}

/* ============================================
   STATUS CELLS
   ============================================ */
.status-cell {
    position: relative;
}

.status-cell__time {
    font-variant-numeric: tabular-nums;
    color: var(--gray-darker, #333);
}

.status-cell__status {
    display: block;
    font-weight: 500;
    font-size: 0.8125rem;
}

.status-cell__note {
    display: block;
    font-size: 0.6875rem;
    color: var(--gray, #999);
    margin-top: 2px;
}

.status-cell--booked {
    /* Default look — no extra decoration needed */
}

.status-cell--booked .status-cell__time {
    color: var(--cl-green-dark, #2e7d32);
}

.status-cell--sick {
    background: rgba(244, 67, 54, 0.06);
}

.status-cell--sick .status-cell__status {
    color: var(--cl-red, #f44336);
}

.status-cell--off {
    background: rgba(0, 0, 0, 0.03);
}

.status-cell--off .status-cell__status {
    color: var(--gray, #999);
}

/* Day column highlight when day filter is active */
.overview-table__th--highlighted {
    background: rgba(38, 65, 143, 0.08);
    color: var(--cl-hard, #26418f);
}

.overview-table__td--highlighted {
    background: rgba(38, 65, 143, 0.04);
}

.overview-table__td--dimmed {
    opacity: 0.35;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .week-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-cards {
        flex-direction: column;
    }

    .summary-cards__card {
        min-width: 100%;
    }

    .department-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .department-selector__select {
        width: 100%;
    }
}

/* ============================================
   DARK MODE OVERRIDES
   ============================================ */
body.dark-mode .page-title {
    color: var(--dm-text, #e0e0e0);
}

body.dark-mode .department-selector__select {
    background: var(--dm-surface, #2c2c2c);
    border-color: var(--dm-border, #444);
    color: var(--dm-text, #e0e0e0);
}

body.dark-mode .week-nav {
    background: var(--dm-surface, #2c2c2c);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .week-nav__label {
    color: var(--dm-text, #e0e0e0);
}

body.dark-mode .week-nav__date-range {
    color: var(--dm-text-secondary, #aaa);
}

body.dark-mode .week-nav__arrow {
    background: var(--dm-surface, #2c2c2c);
    border-color: var(--dm-border, #444);
    color: var(--dm-text, #e0e0e0);
}

body.dark-mode .week-nav__arrow:hover {
    background: var(--dm-surface-hover, #3a3a3a);
}

body.dark-mode .day-filter__btn {
    background: var(--dm-surface, #2c2c2c);
    border-color: var(--dm-border, #444);
    color: var(--dm-text-secondary, #aaa);
}

body.dark-mode .day-filter__btn--active {
    background: var(--cl-hard, #26418f);
    border-color: var(--cl-hard, #26418f);
    color: var(--white, #fff);
}

body.dark-mode .status-filter__select {
    background: var(--dm-surface, #2c2c2c);
    border-color: var(--dm-border, #444);
    color: var(--dm-text, #e0e0e0);
}

body.dark-mode .summary-cards__card {
    background: var(--dm-surface, #2c2c2c);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .summary-cards__count {
    color: var(--dm-text, #e0e0e0);
}

body.dark-mode .summary-cards__label {
    color: var(--dm-text-secondary, #aaa);
}

body.dark-mode .overview-table-wrapper {
    background: var(--dm-surface, #2c2c2c);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .overview-table__th {
    background: var(--dm-surface-alt, #333);
    color: var(--dm-text-secondary, #aaa);
    border-bottom-color: var(--dm-border, #444);
}

body.dark-mode .overview-table__th--today {
    background: rgba(38, 65, 143, 0.15);
    color: var(--cl-hard-light, #5c80d4);
}

body.dark-mode .overview-table__row:hover {
    background: var(--dm-surface-hover, #3a3a3a);
}

body.dark-mode .overview-table__td {
    border-bottom-color: var(--dm-border, #444);
    color: var(--dm-text, #e0e0e0);
}

body.dark-mode .overview-table__td[data-day="thu"] {
    background: rgba(38, 65, 143, 0.08);
}

body.dark-mode .status-cell--booked .status-cell__time {
    color: var(--cl-green-light, #81c784);
}

body.dark-mode .status-cell--sick {
    background: rgba(244, 67, 54, 0.1);
}

body.dark-mode .status-cell--off {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .status-cell__note {
    color: var(--dm-text-secondary, #aaa);
}

body.dark-mode .child-info__name {
    color: var(--dm-text, #e0e0e0);
}

body.dark-mode .child-info__avatar {
    background: var(--dm-border, #444);
}

body.dark-mode .department-selector__label,
body.dark-mode .status-filter__label {
    color: var(--dm-text-secondary, #aaa);
}
