/* ═══════════════════════════════════════════════════════════════
   Иддат — стили (цветовая схема, модалки, виджет, бейджи ①②③)
   Надстройка над calendar-hayd.css — переиспользуем .hayd-time-modal-*
   ═══════════════════════════════════════════════════════════════ */

:root {
    --cal-iddah:           #7C3AED;  /* фиолетовый — основной */
    --cal-iddah-bg:        #EDE9FE;  /* светло-фиолетовый фон */
    --cal-iddah-cell:      rgba(124, 58, 237, 0.18);
    --cal-iddah-cell-light: rgba(124, 58, 237, 0.08);
    --cal-iddah-border:    rgba(124, 58, 237, 0.35);
    --cal-iddah-text:      #5B21B6;
}

/* ── Дни иддата на календаре (второй слой поверх хайд/тухр) ── */
.cal-day.iddah-day {
    box-shadow: inset 0 -3px 0 0 var(--cal-iddah-border);
}

.cal-day.iddah-day::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--cal-iddah-cell-light);
    border-radius: inherit;
    z-index: 0;
}

.cal-day.iddah-day > * { position: relative; z-index: 1; }

/* Начало иддата */
.cal-day.iddah-day-start::before {
    content: '⏳';
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 10px;
    z-index: 2;
}

/* Ожидаемая дата окончания (пунктир) */
.cal-day.iddah-day-end-projected::before {
    content: '✅';
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 10px;
    opacity: 0.55;
    z-index: 2;
}

/* Фактическая дата окончания (сплошная) */
.cal-day.iddah-day-end-actual::before {
    content: '✅';
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 10px;
    z-index: 2;
}

/* Бейдж цикла иддата ①②③ */
.iddah-cycle-mark {
    position: absolute;
    top: 1px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cal-iddah);
    color: #fff;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
    font-weight: 700;
    z-index: 3;
    pointer-events: none;
    animation: iddah-badge-pop 0.32s ease-out;
}

@keyframes iddah-badge-pop {
    0%   { transform: scale(0);   opacity: 0; }
    60%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1);   opacity: 1; }
}

/* ── Виджет прогресса ── */
.iddah-widget {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid var(--cal-iddah-border);
    background: var(--cal-iddah-bg);
    border-radius: 8px;
    font-size: 13px;
    color: var(--cal-iddah-text);
}

.iddah-widget-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 6px;
}

.iddah-widget-header .iddah-icon {
    font-size: 16px;
}

.iddah-progress-bar {
    height: 8px;
    background: rgba(124, 58, 237, 0.14);
    border-radius: 4px;
    overflow: hidden;
    margin: 6px 0;
}

.iddah-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6, #7C3AED);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.iddah-widget-row {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 12px;
    color: #4C1D95;
}

.iddah-widget-hint {
    margin-top: 6px;
    font-size: 11px;
    color: #6D28D9;
    font-style: italic;
}

.iddah-widget-badges {
    display: inline-flex;
    gap: 4px;
    margin-inline-start: 6px;
}

.iddah-widget-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.12);
    color: var(--cal-iddah-text);
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
    border: 1px solid var(--cal-iddah-border);
}

.iddah-widget-badge.filled {
    background: var(--cal-iddah);
    color: #fff;
    border-color: var(--cal-iddah);
}

/* ── Легенда ── */
.hayd-legend-dot.legend-iddah {
    background: var(--cal-iddah);
    border: 1px solid var(--cal-iddah);
}

/* ── Контекстное меню ── */
.cal-ctx-icon-dot.iddah {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cal-iddah);
    margin-inline-end: 6px;
}

.cal-ctx-item.cal-ctx-iddah.active-iddah #calCtxIddahLabel::after {
    content: ' (активен)';
    color: var(--cal-iddah);
    font-weight: 600;
}

/* ── Модалка активации ── */
.iddah-modal-overlay { z-index: 2100; }

.iddah-activate-modal,
.iddah-status-modal {
    max-width: 520px;
    width: calc(100vw - 32px);
}

.iddah-field {
    margin-bottom: 14px;
}

.iddah-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111827;
    font-size: 13px;
}

.iddah-radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.iddah-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.iddah-radio:hover {
    background: #F9FAFB;
}

.iddah-radio input[type="radio"] {
    margin: 0;
    accent-color: var(--cal-iddah);
}

.iddah-radio input[type="radio"]:checked ~ * {
    color: var(--cal-iddah-text);
}

.iddah-auto-detect {
    padding: 10px 12px;
    background: var(--cal-iddah-bg);
    border: 1px solid var(--cal-iddah-border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--cal-iddah-text);
}

.iddah-auto-line {
    margin-bottom: 4px;
}
.iddah-auto-line:last-child { margin-bottom: 0; }

/* ── Модалка статуса ── */
.iddah-status-header {
    background: var(--cal-iddah-bg);
    border: 1px solid var(--cal-iddah-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.iddah-status-type {
    font-size: 18px;
    font-weight: 700;
    color: var(--cal-iddah-text);
    margin-bottom: 4px;
}

.iddah-status-reason {
    font-size: 12px;
    color: #6B7280;
}

.iddah-status-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
    font-size: 12px;
}

.iddah-status-date-label {
    color: #6B7280;
    font-size: 11px;
    margin-bottom: 2px;
}

.iddah-status-date-value {
    color: #111827;
    font-weight: 600;
}

.iddah-status-progress {
    margin: 12px 0;
}

.iddah-status-badges {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 14px 0;
}

.iddah-status-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.08);
    border: 2px solid var(--cal-iddah-border);
    color: var(--cal-iddah-text);
    font-size: 18px;
    line-height: 32px;
    text-align: center;
    font-weight: 700;
    transition: all 0.2s;
}

.iddah-status-badge.filled {
    background: var(--cal-iddah);
    color: #fff;
    border-color: var(--cal-iddah);
    animation: iddah-badge-pop 0.32s ease-out;
}

.iddah-status-message {
    margin-top: 12px;
    padding: 10px 12px;
    background: #F9FAFB;
    border-inline-start: 3px solid var(--cal-iddah);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: #374151;
    white-space: pre-wrap;
}

/* Тост и панель истории иддата вынесены в notification-center.css
   (универсальный центр уведомлений для всего календаря). */

/* ── Кнопки действий в виджете (Сообщения / Подробнее) ── */
.iddah-widget-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 8px;
}

.iddah-widget-action-btn {
    position: relative;
    font-size: 11px;
    background: transparent;
    border: 1px solid var(--cal-iddah-border);
    color: var(--cal-iddah-text);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.iddah-widget-action-btn:hover {
    background: var(--cal-iddah-bg);
}

.iddah-msg-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--cal-iddah);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    text-align: center;
}

/* ── Адаптив ── */
@media (max-width: 640px) {
    .iddah-status-dates {
        grid-template-columns: 1fr;
    }
}
