/* Admin Panel Styles */

.admin-body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    background: #f5f5f5;
}

/* Login */
.admin-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #2B7A2B 0%, #1a5a1a 100%);
}

.admin-login__card {
    background: #fff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
}

.admin-login__card h1 {
    text-align: center;
    margin: 1.5rem 0;
    color: #333;
}

.admin-login__logo {
    text-align: center;
}

/* Sidebar */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: #1a3a1a;
    color: #fff;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.admin-sidebar__logo {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar__logo img {
    filter: brightness(10);
}

.admin-nav {
    padding: 1rem 0;
    flex: 1;
}

.admin-nav hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0.5rem 0;
}

.admin-nav__link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
}

.admin-nav__link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.admin-nav__link i {
    width: 24px;
    margin-right: 0.5rem;
}

/* Main content */
.admin-main {
    margin-left: 250px;
    min-height: 100vh;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar h1 {
    font-size: 1.25rem;
    color: #333;
}

.admin-topbar__user {
    color: #666;
    font-size: 0.875rem;
}

.admin-content {
    padding: 2rem;
}

/* Cards */
.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.admin-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.admin-card__icon {
    width: 50px;
    height: 50px;
    background: #2B7A2B;
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.admin-card__info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.admin-card__info p {
    color: #666;
    font-size: 0.875rem;
}

.admin-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-indent: -9999px;
}

/* Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.admin-table thead {
    background: #f8f8f8;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    font-weight: 600;
    font-size: 0.875rem;
    color: #666;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--green {
    background: #e6f4e6;
    color: #2B7A2B;
}

.badge--gray {
    background: #f0f0f0;
    color: #666;
}

/* Admin form */
.admin-form {
    max-width: 600px;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Small button variant */
.btn--small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn--danger {
    background: #dc3545;
    color: #fff;
}

.btn--danger:hover {
    background: #c82333;
}

/* SchoutenAI branding — login */
.admin-login__credit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-top: 1.75rem;
    text-decoration: none;
    opacity: 0.65;
    transition: opacity 0.2s;
}

.admin-login__credit:hover { opacity: 1; }

.admin-login__credit-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-login__credit-logo {
    width: 130px;
    height: auto;
    display: block;
}

/* SchoutenAI branding — sidebar */
.admin-sidebar__credit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.admin-sidebar__credit:hover { opacity: 1; }

.admin-sidebar__credit-logo {
    width: 110px;
    height: auto;
    display: block;
}

/* ============================================================
   Visuele Editor (WYSIWYG)
   ============================================================ */

/* Canvas wrapper — contains the live page content in the admin editor */
.admin-editor-canvas {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    min-height: 300px;
    position: relative;
}

.admin-editor-editable {
    outline: 1px dashed rgba(43, 122, 43, 0.35);
    outline-offset: 2px;
    border-radius: 2px;
    min-height: 1em;
}

.admin-editor-editable:focus {
    outline: 2px solid var(--color-primary, #2B7A2B);
    outline-offset: 2px;
}

.admin-editor-image {
    cursor: pointer;
    outline: 2px solid rgba(43, 122, 43, 0.25);
    transition: outline-color 0.15s;
}

.admin-editor-image:hover {
    outline-color: rgba(43, 122, 43, 0.6);
}

.admin-editor-image-active {
    outline: 3px solid #2B7A2B;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(43, 122, 43, 0.15);
}

/* Floating toolbar above selected image */
.admin-editor-toolbar {
    position: fixed;
    z-index: 9999;
    display: flex;
    gap: 6px;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}

.admin-editor-btn {
    border: 0;
    border-radius: 6px;
    padding: 7px 12px;
    background: #2B7A2B;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s;
}

.admin-editor-btn:hover { background: #1f5c1f; }

.admin-editor-btn-secondary {
    background: #666;
}

.admin-editor-btn-secondary:hover { background: #444; }

/* Crop modal */
.admin-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-crop-modal[hidden] {
    display: none !important;
}

.admin-crop-dialog {
    width: min(960px, 100%);
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.admin-crop-title {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.admin-crop-help {
    margin: 0 0 14px;
    color: #666;
    font-size: 0.875rem;
}

.admin-crop-viewport-wrap {
    display: flex;
    justify-content: center;
}

.admin-crop-viewport {
    position: relative;
    overflow: hidden;
    background: #e8e8e8;
    border: 1px solid #ddd;
    border-radius: 8px;
    touch-action: none;
    user-select: none;
}

.admin-crop-viewport img {
    position: absolute;
    left: 0;
    top: 0;
    max-width: none;
    max-height: none;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.admin-crop-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    font-size: 0.875rem;
    color: #555;
}

.admin-crop-controls input[type="range"] {
    width: 240px;
    max-width: 100%;
}

.admin-crop-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }
    .admin-main {
        margin-left: 0;
    }
}

/* Force reveal animations visible in editor canvas */
.admin-editor-canvas .reveal,
.admin-editor-canvas .reveal-left,
.admin-editor-canvas .reveal-right {
    opacity: 1 !important;
    transform: none !important;
}

/* Hero fixes in editor */
.admin-editor-canvas .hero:not(.hero--small) {
    position: relative !important; /* prevent sticky scroll in editor */
    min-height: 70vh;
}

/* Let clicks pass through the overlay so the background image is clickable */
.admin-editor-canvas .hero__overlay {
    pointer-events: none;
}

/* Container queries — react to canvas width, not viewport width */
#editor-canvas {
    container-type: inline-size;
    container-name: editor;
}

@container editor (max-width: 900px) {
    .content-block--image-text {
        grid-template-columns: 1fr;
    }
    .content-block--image-text img {
        height: 250px;
    }
    .content-block--reverse {
        direction: ltr;
    }
}

@container editor (max-width: 768px) {
    .hero__title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }
    .hero__description {
        font-size: var(--fs-base, 1rem);
    }
    .hero--small {
        min-height: 45vh;
    }
    .hero__buttons {
        flex-direction: column;
        align-items: center;
    }
    .hero__buttons .btn {
        width: 100%;
        max-width: 320px;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .split-layout {
        grid-template-columns: 1fr;
        gap: var(--space-2xl, 3rem);
    }
    .split-layout--reverse {
        direction: ltr;
    }
}

@container editor (max-width: 480px) {
    .hero {
        min-height: 90vh;
    }
}

/* Viewport switcher */
.editor-viewport-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

.editor-viewport-bar .btn.is-active {
    background: #2B7A2B;
    color: #fff;
    border-color: #2B7A2B;
}

/* Mobile canvas wrapper */
.admin-editor-canvas--mobile-view {
    max-width: 390px;
    margin: 0 auto;
}
