/* ============================================
   Work Schedule Calendar — setiwik style
   ============================================ */

/* Обёртка плагина */
.wsc-plugin {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    overflow: hidden;
}

/* ---- Форма / Сетка управления ---- */
.wsc-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.wsc-section {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
}

.wsc-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111111;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #dd3333;
}

/* ---- Радио-кнопки (скрытые, только подсветка) ---- */
.wsc-radio-list {
    display: grid;
    gap: 6px;
}

.wsc-radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fff;
    transition: all 0.15s ease;
    user-select: none;
    position: relative;
}

.wsc-radio-item:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

.wsc-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wsc-radio-item.is-selected {
    background: #fef2f2;
    border-color: #dd3333;
    font-weight: 600;
}

.wsc-radio-item span {
    line-height: 1.3;
    padding-left: 5px;
}

/* ---- Конструктор шагов ---- */
.wsc-step-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.wsc-step-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wsc-step-row select,
.wsc-step-row input[type="number"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #111;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}

.wsc-step-row select:focus,
.wsc-step-row input[type="number"]:focus {
    border-color: #dd3333;
}

/* ---- Общие инпуты формы ---- */
.wsc-section input[type="date"],
.wsc-section select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #111;
    background: #fff;
    margin-top: 4px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.wsc-section input[type="date"]:focus,
.wsc-section select:focus {
    border-color: #dd3333;
}

.wsc-section label {
    font-weight: 600;
    color: #111111;
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

.wsc-section label span {
    display: block;
    margin-bottom: 5px;
}

/* ---- Кнопки ---- */
.wsc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.wsc-btn {
    background: #dd3333;
    color: #fff;
    border: 2px solid #dd3333;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.wsc-btn:hover {
    background: #b62a2a;
    border-color: #b62a2a;
}

.wsc-btn-secondary {
    background: #fff;
    color: #dd3333;
    padding: 10px 20px;
}

.wsc-btn-secondary:hover {
    background: #dd3333;
    color: #fff;
}

/* ---- Сводка / Статистика ---- */
.wsc-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.wsc-summary-item {
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
}

.wsc-summary-item strong {
    color: #111;
}

/* ---- Сетка месяцев (ВСЕГДА 1 колонка) ---- */
.wsc-calendar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ---- Карточка месяца ---- */
.wsc-month-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.wsc-month-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #dd3333;
}

/* ---- Таблица календаря ---- */
.wsc-calendar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
}

.wsc-calendar-table {
    width: 100%;
    min-width: 300px;
    border-collapse: collapse;
    table-layout: fixed;
}

.wsc-calendar-table th {
    background: #dd3333;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 4px;
    text-align: center;
    border: 1px solid #c62c2c;
}

.wsc-calendar-table td {
    border: 1px solid #eee;
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    vertical-align: top;
    min-height: 50px;
    transition: background 0.15s;
}

/* ---- Цвета дней ---- */
.wsc-day-working {
    background: #f0fdf4;
}

.wsc-day-off {
    background: #fef2f2;
}

.wsc-day-night {
    background: #fffbeb;
}

.wsc-day-rest {
    background: #eff6ff;
}

.wsc-day-number {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #111;
}

.wsc-day-label {
    display: block;
    font-size: 10px;
    margin-top: 3px;
    color: #666;
}

/* ---- Адаптив ---- */
@media (max-width: 768px) {
    .wsc-plugin {
        padding: 14px;
    }

    .wsc-controls {
        grid-template-columns: 1fr;
    }

    .wsc-section {
        padding: 14px;
    }

    .wsc-step-row {
        flex-direction: column;
        align-items: stretch;
    }

    .wsc-actions {
        flex-direction: column;
    }

    .wsc-actions .wsc-btn {
        width: 100%;
        text-align: center;
    }

    .wsc-summary {
        grid-template-columns: 1fr;
    }

    .wsc-month-card {
        padding: 12px;
    }

    .wsc-calendar-table th,
    .wsc-calendar-table td {
        padding: 3px 2px;
        font-size: 10px;
        line-height: 1.2;
    }

    .wsc-day-number {
        font-size: 11px;
    }

    .wsc-day-label {
        font-size: 9px;
    }
}