/* ========================================= */
/* 📦 CONTENT MANAGEMENT (ADMIN & EDITOR)    */
/* ========================================= */

/* --- Dashboard Grid (Admin Main Screen) --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 колонки для лучшей адаптации */
    gap: 10px;
    margin-bottom: 20px;
}

.admin-dash-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 5px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    position: relative;
    height: 100%;
    min-height: 80px;
    transition: all 0.2s;
}

    .admin-dash-btn:hover {
        border-color: var(--primary);
        background: var(--hover);
    }

    /* --- Special "Main Action" Button (Programs) --- */
    .admin-dash-btn.main-action {
        grid-column: span 2; /* Растягиваем на всю ширину сетки */
        flex-direction: row; /* Иконка слева, текст справа */
        justify-content: flex-start;
        padding: 0 20px;
        background: linear-gradient(135deg, rgba(145, 71, 255, 0.1) 0%, rgba(145, 71, 255, 0.0) 100%);
        border-color: rgba(145, 71, 255, 0.3);
    }

        .admin-dash-btn.main-action .material-symbols-outlined {
            margin-right: 15px;
            background: var(--surface);
            padding: 8px;
            border-radius: 50%;
            border: 1px solid var(--border);
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

/* --- Admin Plan List & Frames --- */
.admin-frame {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.2s;
}

    .admin-frame:hover {
        border-color: rgba(255, 255, 255, 0.3);
    }

/* Status toggles inside Plan Headers */
.plan-status-control {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
}

/* --- Compact Settings (Anti-copy, Watermark) --- */
.compact-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.compact-setting-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    min-height: 80px;
}

    .compact-setting-card h3 {
        margin: 0;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text-sec);
    }

    .compact-setting-card .material-symbols-outlined {
        font-size: 24px !important;
        margin-bottom: 2px;
    }

/* --- Action Buttons (Edit/Delete/Visible) --- */
.action-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn {
    width: 32px; /* Компактный размер */
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-sec);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

    .action-btn:hover {
        color: var(--text);
        background: rgba(255, 255, 255, 0.1);
    }

    .action-btn.delete:hover {
        color: #ff1744;
        background: rgba(255, 17, 68, 0.1);
    }

/* --- Floating Add Button (FAB) --- */
.fab-add-btn {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 15px rgba(145, 71, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1500;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: zoomIn 0.3s ease-out;
}

    .fab-add-btn:active {
        transform: scale(0.9);
    }

    .fab-add-btn .material-symbols-outlined {
        font-size: 28px;
    }

/* --- Drag & Drop (SortableJS) --- */
.drag-handle {
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--text-sec);
    opacity: 0.5;
    transition: all 0.2s;
    flex-shrink: 0;
    -webkit-touch-callout: none;
    user-select: none;
}

    .drag-handle:hover {
        opacity: 1;
        background: rgba(145, 71, 255, 0.1);
        color: var(--primary);
    }

    .drag-handle:active {
        cursor: grabbing;
    }

/* Sortable States */
.sortable-ghost {
    opacity: 0.4;
    background: var(--hover);
    border: 1px dashed var(--text-sec);
}

.sortable-drag {
    opacity: 1 !important;
    background: var(--surface);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
    cursor: grabbing;
    transform: scale(1.02);
    z-index: 9999;
}

.sortable-chosen {
    background: var(--hover);
}

/* --- Editor & Items --- */
.workout-item .drag-handle {
    margin-right: 5px;
}

.editor-block-item .drag-handle {
    margin-right: 8px;
}

/* --- Mobile Adjustments --- */
@media (max-width: 380px) {
    .action-btn {
        width: 28px;
        height: 28px;
    }

        .action-btn span {
            font-size: 16px !important;
        }

    .admin-frame .acc-header {
        padding: 8px 6px !important;
    }
}

/* --- Стили для кнопок в модалке --- */
.modal-footer {
    display: flex;
    justify-content: flex-end; /* Кнопки справа */
    gap: 10px; /* Расстояние между кнопками */
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border); /* Линия разделитель сверху */
}

/* Красивая основная кнопка (Сохранить/Создать) */
.btn-primary {
    background: var(--primary); /* Твой фиолетовый цвет */
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px; /* Скругление */
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .btn-primary:hover {
        opacity: 0.9;
    }

    .btn-primary:active {
        transform: scale(0.98); /* Эффект нажатия */
    }

/* Кнопка отмены (второстепенная) */
.btn-secondary {
    background: transparent;
    color: var(--text-sec); /* Вторичный цвет текста */
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-main);
    }

/* Специфичный селектор, чтобы перебить общие стили .drag-handle */
.week-wrapper .acc-header .drag-handle.week-drag-handle {
    /* Сбрасываем фиксированные размеры от общего .drag-handle */
    width: 50px !important;
    height: auto !important;
    /* Позиционирование (дублирует JS для надежности) */
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    /* Центрирование иконки */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: var(--text-sec);
    transition: color 0.2s, background 0.2s;
    border-radius: 0; /* Убираем скругление, так как это зона сбоку */
}

    .week-wrapper .acc-header .drag-handle.week-drag-handle:hover {
        color: var(--primary);
        background: rgba(145, 71, 255, 0.1);
    }