﻿.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-blue);
}

    .admin-header h1 {
        color: var(--primary-dark);
    }

.btn-back {
    background: var(--text-gray);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

    .btn-back:hover {
        background: var(--primary-dark);
    }

.login-required {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.subpages-panel {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

    .subpages-panel h2 {
        color: var(--primary-dark);
    }

.no-pages {
    text-align: center;
    color: var(--text-gray);
    padding: 3rem;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.page-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.2s;
}

    .page-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

.page-header h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.page-slug {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-family: monospace;
}

.page-meta {
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.page-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit, .btn-view, .btn-delete, .btn-success, .btn-info, .btn-secondary {
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-edit {
    background: var(--accent-blue);
    color: white;
}

    .btn-edit:hover {
        background: var(--primary-blue);
    }

.btn-view {
    background: var(--text-gray);
    color: white;
}

    .btn-view:hover {
        background: var(--primary-dark);
    }

.btn-delete {
    background: #e74c3c;
    color: white;
}

    .btn-delete:hover {
        background: #c0392b;
    }

.btn-success {
    background: #27ae60;
    color: white;
}

    .btn-success:hover {
        background: #229954;
    }

.btn-info {
    background: var(--accent-blue);
    color: white;
}

    .btn-info:hover {
        background: var(--primary-blue);
    }

.btn-secondary {
    background: var(--text-gray);
    color: white;
}

    .btn-secondary:hover {
        background: var(--primary-dark);
    }

.editor-panel {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

    .editor-panel h2 {
        color: var(--primary-dark);
    }

.form-group {
    margin-bottom: 1rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        color: var(--primary-dark);
        font-weight: 500;
    }

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
}

    .form-input:focus {
        outline: none;
        border-color: var(--accent-blue);
    }

.wysiwyg-editor {
    min-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    background: white;
    overflow-y: auto;
}

    .wysiwyg-editor:focus {
        outline: none;
        border-color: var(--accent-blue);
    }

    .wysiwyg-editor table {
        border-collapse: collapse;
        width: 100%;
        margin: 1rem 0;
    }

        .wysiwyg-editor table td, .wysiwyg-editor table th {
            border: 1px solid var(--border-color);
            padding: 0.5rem;
        }

        .wysiwyg-editor table th {
            background: var(--bg-light);
            font-weight: 600;
        }

.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.toolbar-btn {
    border: 1px solid var(--border-color);
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

    .toolbar-btn:hover {
        background: var(--accent-blue);
        color: white;
        border-color: var(--accent-blue);
    }

.toolbar-divider {
    color: var(--border-color);
    margin: 0 0.25rem;
}

.editor-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

    .modal-header h2 {
        color: var(--primary-dark);
    }

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-gray);
    cursor: pointer;
}

    .close-btn:hover {
        color: var(--primary-dark);
    }

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.image-item {
    aspect-ratio: 1;
    background: var(--bg-light);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

    .image-item:hover {
        background: var(--light-blue);
        transform: scale(1.05);
    }

    .image-item img {
        max-width: 100%;
        max-height: 100%;
        object-fit: cover;
    }

    .image-item span {
        position: absolute;
        bottom: 0.5rem;
        font-size: 0.75rem;
        color: var(--text-dark);
        background: rgba(255, 255, 255, 0.9);
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
    }

#pageEditor img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

    #pageEditor img:hover {
        border-color: var(--accent-blue);
    }

    #pageEditor img.selected {
        border-color: var(--accent-blue);
        box-shadow: 0 0 10px rgba(93, 138, 168, 0.3);
    }

.image-size-controls {
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: none;
}

    .image-size-controls.active {
        display: block;
    }

.size-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.size-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.9rem;
}

    .size-btn:hover {
        background: var(--accent-blue);
        color: white;
        border-color: var(--accent-blue);
    }

.size-slider {
    width: 100%;
    margin-top: 0.5rem;
}
