/* ═══════════════════════════════════════════════
   Chatunda Layout Selector — Page Styles
   ═══════════════════════════════════════════════ */

:root {
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --accent: #3b82f6;
    --accent-light: #eff6ff;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* ═══════════ Header ═══════════ */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.site-header__logo { flex-shrink: 0; }
.site-header__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.lang-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-muted);
    transition: border-color 0.15s;
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-toggle__active { font-weight: 700; color: var(--text); }
.lang-toggle__sep { margin: 0 4px; color: var(--border); }

/* ═══════════ Color Bar ═══════════ */
.color-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 49px;
    z-index: 99;
}
.color-bar__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.color-bar__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.color-bar__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}
.color-bar__picker {
    width: 38px;
    height: 38px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: none;
}
.color-bar__picker::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}
.color-bar__hex {
    width: 90px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 14px;
    text-align: center;
    color: var(--text);
}
.color-bar__hex:focus { outline: 2px solid var(--accent); border-color: transparent; }
.color-bar__swatches {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}
.swatch:hover { transform: scale(1.15); }
.swatch--active { border-color: var(--text); transform: scale(1.1); }

/* ═══════════ Category Nav ═══════════ */
.category-nav {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}
.category-nav__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.category-nav__inner::-webkit-scrollbar { display: none; }
.cat-tab {
    background: none;
    border: none;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.cat-tab:hover { color: var(--text); }
.cat-tab--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* ═══════════ Layout Grid ═══════════ */
.layout-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.layout-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.layout-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.layout-card__preview {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.layout-card__preview-container {
    transform: scale(0.52);
    transform-origin: top center;
    position: absolute;
    top: 16px;
}
.layout-card__info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.layout-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.layout-card__name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.layout-card__badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-light);
    color: var(--accent);
}
.layout-card__desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}
.layout-card__action {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.layout-card__btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.layout-card__btn:hover { filter: brightness(0.92); transform: scale(1.01); }

/* ═══════════ Modal ═══════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay--visible { display: flex; }
.modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    padding: 28px;
    position: relative;
    animation: modal-in 0.25s ease;
}
@keyframes modal-in {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.modal__close:hover { color: var(--text); }
.modal__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    padding-right: 32px;
}
.modal__desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.modal__preview {
    width: 100%;
    height: 380px;
    background: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.modal__config {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.modal__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.modal__code-row {
    display: flex;
    gap: 8px;
}
.modal__code-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 12px;
    background: #f8fafc;
    color: var(--text);
}
.modal__copy-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.modal__copy-btn:hover { filter: brightness(0.92); }
.modal__copy-btn--copied { background: #10b981; }
.modal__hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ═══════════ Integratiemodus ═══════════ */
.integration-mode .modal__config { display: none !important; }
.integration-mode .modal__confirm { display: block !important; }

.modal__confirm {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.modal__confirm-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 14px 48px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.modal__confirm-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}
.modal__confirm-btn:active {
    transform: translateY(0);
}
.modal__confirm-btn:disabled {
    background: #94a3b8;
    cursor: wait;
    box-shadow: none;
    transform: none;
}
.modal__confirm-hint {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Integratie banner bovenaan */
.integration-mode .site-header {
    border-bottom: 3px solid #10b981;
}

/* ═══════════ Responsive ═══════════ */
@media (max-width: 900px) {
    .layout-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 600px) {
    .layout-grid { grid-template-columns: 1fr; padding: 16px; }
    .color-bar__inner { padding: 12px 16px; }
    .color-bar__label { display: none; }
    .site-header__inner { padding: 10px 16px; }
    .modal { padding: 20px; margin: 12px; }
    .layout-card__preview { height: 280px; }
}
