/* =====================================================
   ОЗЕРО ДРУЗЕЙ — admin.css (админ-панель и настройки)
   ===================================================== */

.admin-wrap {
    max-width: 900px;
    padding: 2rem 0 1rem;
}

.admin-card {
    padding: 1.4rem;
    margin-bottom: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

.admin-table th,
.admin-table td {
    padding: .55rem .6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--muted);
    font-size: .85rem;
}

.admin-table .actions form {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.check-line {
    display: flex;
    gap: .6rem;
    align-items: center;
    font-weight: 600;
    margin-bottom: .8rem;
}

.block-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .5rem 0;
    border-bottom: 1px dashed var(--border);
}

/* ---------- Две колонки в контенте ---------- */
.admin-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .admin-two-cols {
        grid-template-columns: 1fr;
    }
}

/* Стили для блочного редактора (только админка) */
.block {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    transition: box-shadow 0.2s;
}

.block:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.block-ghost {
    opacity: 0.5;
    background: #f0f0f0;
}

.block-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.block-handle:active {
    cursor: grabbing;
}

.drag-icon {
    font-size: 1.2rem;
    color: var(--text-muted, #999);
    line-height: 1;
}

.delete-btn {
    background: none;
    border: none;
    color: #d33;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.block:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: #a00;
}

.block-content {
    flex: 1;
    min-width: 0;
}

.text-block {
    min-height: 60px;
    padding: 0.5rem;
    border: 1px solid transparent;
    border-radius: 4px;
    outline: none;
    line-height: 1.6;
}

.text-block:focus {
    border-color: var(--primary, #2a9d8f);
    background: rgba(42, 157, 143, 0.05);
}

.text-block:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted, #999);
}

.text-toolbar {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border, #eee);
}

.toolbar-btn {
    background: none;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.toolbar-btn:hover {
    background: var(--primary, #2a9d8f);
    color: #fff;
    border-color: var(--primary, #2a9d8f);
}

.header-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    outline: none;
}

.header-input:focus {
    border-color: var(--primary, #2a9d8f);
}

.header-level {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    font-size: 0.85rem;
}

.image-preview {
    margin-bottom: 0.75rem;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.image-upload {
    margin-bottom: 0.75rem;
}

.image-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.image-size,
.image-align {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    font-size: 0.85rem;
}

.image-caption {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
}

.image-caption:focus {
    border-color: var(--primary, #2a9d8f);
}

.video-url {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
}

.video-url:focus {
    border-color: var(--primary, #2a9d8f);
}

.list-type {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    font-size: 0.85rem;
}

.list-items {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

.list-items:focus {
    border-color: var(--primary, #2a9d8f);
}

/* Стили для WYSIWYG редактора v3 */
.editable-text {
    min-height: 40px;
    padding: 0.5rem;
    outline: none;
    line-height: 1.6;
    border: 1px dashed transparent;
    border-radius: 4px;
}

.editable-text:focus {
    border-color: var(--primary);
    background: rgba(42, 157, 143, 0.05);
}

.editable-text:empty::before {
    content: attr(data-placeholder);
    color: #999;
}

.editable-header {
    margin: 0;
    padding: 0.25rem 0;
    outline: none;
    border-bottom: 1px dashed transparent;
}

.editable-header:focus {
    border-bottom-color: var(--primary);
}

.editable-header:empty::before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

.image-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.img-half img {
    max-width: 50%;
}

.img-quarter img {
    max-width: 25%;
}

.img-circle img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.img-left {
    float: left;
    margin-right: 1rem;
}

.img-right {
    float: right;
    margin-left: 1rem;
}

/* =====================================================
   ДОБАВЛЕНО: контролы внутри WYSIWYG-блоков
   ===================================================== */
.image-controls-wysiwyg {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
}

.image-size-select,
.image-align-select,
.list-type-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    font-size: 0.85rem;
}

.image-caption-input,
.video-url-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}

.image-caption-input:focus,
.video-url-input:focus {
    border-color: var(--primary);
}

.editable-list {
    padding-left: 1.5rem;
    min-height: 30px;
    outline: none;
    line-height: 1.6;
}

.editable-list:focus {
    background: rgba(42, 157, 143, 0.05);
    border-radius: 4px;
}

.video-wrapper iframe {
    border-radius: 8px;
}
#add-block-menu {
    min-width: 220px;
}

#add-block-menu button {
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
}