/*
   Courses Collections Styles - Вкладка «Подборка» на странице курсов
   Файл: assets/css/courses/courses-collections.css
   Логика — assets/js/courses/courses-collections.js. Гамма — бирюзовая,
   как у вкладок страницы курсов; карточки тренировок красятся цветом курса.
*/

/* Общая «стеклянная» карточка с бирюзовой рамкой */
.ccol-card,
.ccol-header,
.ccol-workout,
.ccol-group {
    position: relative;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark-theme .ccol-card,
.dark-theme .ccol-header,
.dark-theme .ccol-workout,
.dark-theme .ccol-group {
    background: rgba(30, 30, 46, 0.85);
}

.ccol-card::before,
.ccol-header::before,
.ccol-workout::before,
.ccol-group::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.45), rgba(20, 184, 166, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* ========== СПИСОК ПОДБОРОК ========== */
.ccol-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.ccol-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ccol-card:active {
    transform: scale(0.98);
}

.ccol-card-emoji {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7em;
    background: rgba(20, 184, 166, 0.12);
}

.ccol-card-text {
    flex: 1;
    min-width: 0;
}

.ccol-card-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #1e293b;
    overflow-wrap: anywhere;
}

.dark-theme .ccol-card-name {
    color: #ffffff;
}

.ccol-card-count {
    margin-top: 3px;
    font-size: 0.85em;
    color: #64748b;
}

.dark-theme .ccol-card-count {
    color: #b3b3cc;
}

.ccol-card-arrow {
    flex-shrink: 0;
    font-size: 1.3em;
    color: #14b8a6;
}

.ccol-create-btn {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.3);
    position: relative;
    z-index: 1;
}

.ccol-empty .ccol-create-btn {
    margin-top: 14px;
}

/* ========== ШАПКА ПОДБОРКИ / ВЫБОРА ========== */
.ccol-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.ccol-back {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #14b8a6;
    font-size: 1.5em;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.ccol-header-text {
    flex: 1;
    min-width: 0;
}

.ccol-header-title {
    font-size: 1.15em;
    font-weight: 800;
    color: #1e293b;
    overflow-wrap: anywhere;
}

.dark-theme .ccol-header-title {
    color: #ffffff;
}

.ccol-header-sub {
    margin-top: 2px;
    font-size: 0.85em;
    color: #64748b;
}

.dark-theme .ccol-header-sub {
    color: #b3b3cc;
}

.ccol-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ccol-actions .ccol-btn {
    width: auto;
    flex: 1;
    padding: 10px 8px;
    font-size: 0.85em;
}

.ccol-actions .ccol-btn-danger {
    flex: 0 0 48px;
}

/* ========== КНОПКИ ========== */
.ccol-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(20, 184, 166, 0.35);
    background: rgba(255, 255, 255, 0.85);
    color: #0f766e;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
}

.dark-theme .ccol-btn {
    background: rgba(30, 30, 46, 0.85);
    color: #5eead4;
}

.ccol-btn-main,
.dark-theme .ccol-btn-main {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    border-color: transparent;
    color: #ffffff;
}

.ccol-btn-quiet,
.dark-theme .ccol-btn-quiet {
    background: none;
    border-color: transparent;
    color: #94a3b8;
}

.ccol-btn-danger,
.dark-theme .ccol-btn-danger {
    border-color: rgba(239, 68, 68, 0.35);
    color: #dc2626;
}

/* ========== ВЫБОР ТРЕНИРОВОК ========== */
.ccol-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 80px; /* место под кнопку «Сохранить» */
}

.ccol-group {
    padding: 16px;
}

.ccol-group > * {
    position: relative;
    z-index: 1;
}

.ccol-group-title {
    font-size: 1.05em;
    font-weight: 800;
    color: #0f766e;
    margin-bottom: 4px;
}

.dark-theme .ccol-group-title {
    color: #5eead4;
}

.ccol-week-title {
    margin: 12px 0 4px;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.ccol-pick-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 4px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    cursor: pointer;
}

.ccol-pick-row input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: #14b8a6;
}

.ccol-pick-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ccol-pick-title {
    font-weight: 600;
    color: #1e293b;
}

.dark-theme .ccol-pick-title {
    color: #ffffff;
}

.ccol-pick-focus {
    font-size: 0.85em;
    color: #64748b;
}

.dark-theme .ccol-pick-focus {
    color: #b3b3cc;
}

/* ========== КАРТОЧКИ ТРЕНИРОВОК ========== */
.ccol-workouts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ccol-workout {
    padding: 18px;
}

.ccol-workout > * {
    position: relative;
    z-index: 1;
}

.ccol-workout-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ccol-workout-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.6em;
    color: #ffffff;
}

.ccol-workout-titles {
    flex: 1;
    min-width: 0;
}

.ccol-workout-course {
    font-size: 0.75em;
    color: #94a3b8;
}

.ccol-workout-title {
    margin-top: 2px;
    font-size: 1.05em;
    font-weight: 700;
}

.ccol-workout-focus {
    margin-top: 2px;
    font-size: 0.88em;
    color: #64748b;
}

.dark-theme .ccol-workout-focus {
    color: #b3b3cc;
}

.ccol-workout-desc {
    margin-top: 12px;
    font-size: 0.9em;
    font-style: italic;
    line-height: 1.4;
}

.ccol-workout-req {
    margin-top: 10px;
    font-size: 0.85em;
    font-weight: 600;
    color: #475569;
}

.dark-theme .ccol-workout-req {
    color: #cbd5e1;
}

.ccol-workout-videos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.ccol-workout-videos.single {
    grid-template-columns: 1fr;
}

.ccol-video-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
}

/* ========== ОКНО «НОВАЯ ПОДБОРКА» ========== */
.ccol-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ccol-modal-content {
    width: 400px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.97);
    color: #1e293b;
}

.dark-theme .ccol-modal-content {
    background: rgba(30, 30, 46, 0.97);
    color: #f1f5f9;
}

.ccol-modal-title {
    margin-bottom: 12px;
    font-size: 1.15em;
    font-weight: 700;
}

.ccol-label {
    display: block;
    margin: 10px 0 4px;
    font-size: 0.8em;
    font-weight: 600;
    color: #64748b;
}

.ccol-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid rgba(20, 184, 166, 0.35);
    border-radius: 12px;
    background: #ffffff;
    /* Цвет текста и курсора задаём явно: унаследованный белый сливался с полем */
    color: #1e293b;
    caret-color: #0d9488;
    font-family: inherit;
    font-size: 16px; /* меньше 16px — iOS приближает экран при вводе */
    outline: none;
}

.ccol-input:focus {
    border-color: #14b8a6;
}

.dark-theme .ccol-input {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    caret-color: #5eead4;
}

.ccol-input::placeholder {
    color: #94a3b8;
}

.ccol-emoji-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ccol-emoji-input {
    flex: 0 0 64px;
    text-align: center;
    font-size: 22px;
    padding: 8px 4px;
}

.ccol-emoji-hint {
    flex: 1;
    font-size: 0.85em;
    line-height: 1.35;
    color: #64748b;
}

.dark-theme .ccol-emoji-hint {
    color: #b3b3cc;
}

.ccol-msg {
    min-height: 1.2em;
    margin: 10px 0 4px;
    font-size: 0.88em;
    color: #dc2626;
}

.ccol-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

/* ========== ОКНО ЗВЕЗДЫ В КУРСЕ: «СОХРАНИТЬ ТРЕНИРОВКУ» ========== */
.ccol-save-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ccol-save-content .ccol-modal-title {
    margin-bottom: 0;
}

.ccol-save-day {
    margin-top: -6px;
    font-size: 0.9em;
    color: #64748b;
}

.dark-theme .ccol-save-day {
    color: #b3b3cc;
}

.ccol-save-opt,
.ccol-save-col,
.ccol-save-new {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    font-family: inherit;
    font-size: 1em;
    text-align: left;
    cursor: pointer;
}

.dark-theme .ccol-save-opt,
.dark-theme .ccol-save-col,
.dark-theme .ccol-save-new {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}

.ccol-save-opt.is-on,
.ccol-save-col.is-on {
    border-color: #14b8a6;
    background: rgba(20, 184, 166, 0.1);
}

.ccol-save-opt-icon {
    flex: 0 0 28px;
    font-size: 1.4em;
    text-align: center;
    color: #14b8a6;
}

.ccol-save-opt-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ccol-save-opt-name {
    font-weight: 700;
}

.ccol-save-opt-sub {
    font-size: 0.8em;
    color: #64748b;
}

.dark-theme .ccol-save-opt-sub {
    color: #b3b3cc;
}

.ccol-save-check {
    flex: 0 0 20px;
    font-weight: 700;
    text-align: center;
    color: #0d9488;
}

.dark-theme .ccol-save-check {
    color: #5eead4;
}

.ccol-save-arrow {
    flex: 0 0 20px;
    text-align: center;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.ccol-save-arrow.open {
    transform: rotate(180deg);
}

.ccol-save-cols {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh;
    overflow-y: auto;
    padding-left: 16px;
}

.ccol-save-col {
    padding: 10px 12px;
    font-size: 0.95em;
}

.ccol-save-col-emoji {
    flex: 0 0 24px;
    font-size: 1.2em;
    text-align: center;
}

.ccol-save-col-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ccol-save-none {
    margin: 2px 0;
    font-size: 0.88em;
    color: #64748b;
}

.dark-theme .ccol-save-none {
    color: #b3b3cc;
}

.ccol-save-new {
    justify-content: center;
    padding: 10px 12px;
    border-style: dashed;
    font-size: 0.95em;
    font-weight: 600;
    color: #0f766e;
}

.dark-theme .ccol-save-new {
    color: #5eead4;
}

/* ========== ЦВЕТА КУРСА (.ccol-themed) ==========
   Окна, открытые изнутри курса (звезда у дня и «Новая подборка» из неё),
   красятся в цвета этого курса. Переменные ставит JS (courses-collections.js,
   applyTheme) из цветов курса — те же, что у блоков недель и дней:
   --ccol-accent (основной), --ccol-gradient, --ccol-text (заголовки),
   --ccol-tint и --ccol-line (полупрозрачные заливка и рамка). */
.ccol-themed .ccol-modal-title {
    color: var(--ccol-text);
}

.ccol-themed .ccol-save-opt,
.ccol-themed .ccol-save-col,
.ccol-themed .ccol-save-new,
.ccol-themed .ccol-input {
    border-color: var(--ccol-line);
}

.ccol-themed .ccol-save-opt.is-on,
.ccol-themed .ccol-save-col.is-on,
.ccol-themed .ccol-input:focus {
    border-color: var(--ccol-accent);
}

.ccol-themed .ccol-save-opt.is-on,
.ccol-themed .ccol-save-col.is-on {
    background: var(--ccol-tint);
}

.ccol-themed .ccol-save-opt-icon,
.ccol-themed .ccol-save-check,
.ccol-themed .ccol-save-new,
.dark-theme .ccol-themed .ccol-save-check,
.dark-theme .ccol-themed .ccol-save-new {
    color: var(--ccol-text);
}

.ccol-themed .ccol-input,
.dark-theme .ccol-themed .ccol-input {
    caret-color: var(--ccol-accent);
}

.ccol-themed .ccol-btn-main,
.dark-theme .ccol-themed .ccol-btn-main {
    background: var(--ccol-gradient);
}

/* ========== УВЕДОМЛЕНИЕ ========== */
.ccol-toast {
    position: fixed;
    left: 50%;
    bottom: 110px;
    transform: translateX(-50%);
    z-index: 1100;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    font-size: 0.9em;
    text-align: center;
}

@media (max-width: 480px) {
    .ccol-card,
    .ccol-workout {
        padding: 16px;
    }
}
