/* =========================================================
   SoMeSplitter – Kursusfabrikken
   Tema-primær (blå): #1160ff   ·   logo-mærke: orange gradient
   ========================================================= */
:root {
    --blue:      #1160ff;   /* --theme-primary fra kursusfabrikken.dk */
    --blue-dark: #0052f7;
    --blue-soft: #eaf0ff;
    --blue-line: #d6e4ff;

    --orange-grad: linear-gradient(135deg, #ffac34 0%, #fe7610 55%, #da0404 100%);

    --text:   #161616;
    --muted:  #6f6f6f;
    --bg:     #ffffff;
    --soft:   #f6f8ff;
    --border: #e4e7ee;
    --shadow: 0 8px 30px rgba(17, 25, 60, .07);
    --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: inherit; }

.grad-text { color: var(--blue); }

/* ---------- Knapper ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: 12px;
    font-size: 16px; font-weight: 600;
    padding: 14px 26px; cursor: pointer; text-decoration: none;
    transition: transform .06s, box-shadow .15s, background .15s, opacity .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(17, 96, 255, .28); }
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 10px 26px rgba(17, 96, 255, .38); }
.btn-primary:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn.full { width: 100%; }
.btn-mini { padding: 8px 14px; font-size: 13px; background: var(--soft); color: var(--text); border: 1px solid var(--border); }
.btn-mini:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; display: block; }
.brand-text { font-size: 20px; font-weight: 500; letter-spacing: -.2px; }
.brand-text strong { font-weight: 800; }
.brand-by { margin-left: auto; color: var(--muted); font-size: 14px; }

/* ---------- Hero ---------- */
.hero { text-align: center; max-width: 760px; margin: 0 auto; padding: 60px 24px 24px; }
.badge-pill {
    display: inline-block; background: var(--blue-soft); border: 1px solid var(--blue-line);
    color: var(--blue-dark); font-size: 13px; font-weight: 600;
    padding: 7px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 { font-size: clamp(30px, 5vw, 50px); font-weight: 800; letter-spacing: -1px; margin-bottom: 16px; }
.lead { color: var(--muted); font-size: 18px; max-width: 600px; margin: 0 auto; }

/* ---------- Værktøjs-layout ---------- */
.tool {
    max-width: 1120px; margin: 30px auto 0; padding: 0 24px;
    display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start;
}
@media (max-width: 880px) { .tool { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

/* ---------- Beskæring (cropper) ---------- */
.stage-card { display: flex; flex-direction: column; align-items: center; }
.crop-empty {
    width: 100%; min-height: 320px;
    border: 2px dashed #c9d6f5; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    text-align: center; color: var(--muted); cursor: pointer;
    transition: border-color .2s, background .2s;
}
.crop-empty.dragover { border-color: var(--blue); background: var(--blue-soft); }
.crop-empty-ico { font-size: 42px; }

.crop-stage { width: 100%; display: flex; justify-content: center; }
.crop-frame {
    position: relative; overflow: hidden; border-radius: 12px;
    background: #0b0b0f; cursor: grab; touch-action: none;
    box-shadow: 0 10px 30px rgba(17, 25, 60, .14);
}
.crop-frame.grabbing { cursor: grabbing; }
.crop-frame img {
    position: absolute; top: 0; left: 0; transform-origin: 0 0;
    max-width: none; user-select: none; -webkit-user-drag: none; will-change: transform;
}
.crop-overlay { position: absolute; inset: 0; pointer-events: none; }

.crop-tools { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; }
.zoom { display: flex; align-items: center; gap: 10px; flex: 1; }
.zoom-lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.zoom input[type=range] { flex: 1; accent-color: var(--blue); }
.hint { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }

/* ---------- Indstillinger ---------- */
.panel h3 { font-size: 16px; margin-bottom: 10px; }
.panel > h3:not(:first-child), .row-cols { margin-top: 22px; }
.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; width: 100%; }
.seg-btn {
    flex: 1; border: none; background: transparent; padding: 10px 14px;
    font-size: 14px; font-weight: 600; border-radius: 9px; color: var(--muted); cursor: pointer;
    transition: background .15s, color .15s;
}
.seg-btn.active { background: var(--blue); color: #fff; }

.row-cols { display: flex; gap: 26px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.circle {
    width: 40px; height: 40px; border-radius: 50%; border: none;
    background: var(--text); color: #fff; font-size: 20px; cursor: pointer;
    transition: transform .06s, opacity .15s;
}
.circle:hover { opacity: .85; }
.circle:active { transform: scale(.93); }
.count { font-size: 20px; font-weight: 800; min-width: 20px; text-align: center; }

.info-box {
    margin-top: 22px; background: var(--blue-soft); border: 1px solid var(--blue-line);
    border-radius: 12px; padding: 14px 16px; font-size: 13.5px; color: #1c2b53; line-height: 1.5;
}
.info-box strong { color: var(--blue-dark); }

.panel .btn.full { margin-top: 22px; }
.status { min-height: 18px; font-size: 13px; margin-top: 12px; }
.status.error { color: #da0404; }
.status.loading { color: var(--muted); }

/* ---------- Resultat ---------- */
.result-wrap { max-width: 1120px; margin: 28px auto 0; padding: 0 24px; }
.result-card { text-align: center; }
.result-title { font-size: 22px; margin-bottom: 6px; }
.result-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.dim-key { display: inline-block; width: 26px; height: 12px; vertical-align: middle; border-radius: 3px;
    background: linear-gradient(to right, rgba(17,25,60,.45) 0 22%, transparent 22% 78%, rgba(17,25,60,.45) 78% 100%);
    border: 1px solid var(--border); }

.tiles { display: grid; gap: 6px; margin: 0 auto 22px; max-width: 560px; }
.tiles.is-carousel { max-width: 100%; }
.tile { position: relative; line-height: 0; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 6px; }
/* viser de sider, der skjules på profilgitteret (3,125 % i hver side) */
.grid-tile .crop-mask {
    position: absolute; inset: 0; border-radius: 6px; pointer-events: none;
    background: linear-gradient(to right,
        rgba(17,25,60,.46) 0, rgba(17,25,60,.46) 3.125%,
        transparent 3.125%, transparent 96.875%,
        rgba(17,25,60,.46) 96.875%, rgba(17,25,60,.46) 100%);
}
.tile .badge {
    position: absolute; top: 6px; left: 6px; z-index: 2;
    background: rgba(22,22,22,.82); color: #fff; font-size: 11px; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
}
.tile .dl {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 2;
    width: 30px; height: 30px; border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; color: var(--text); font-size: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .1s;
}
.tile .dl:hover { transform: translateX(-50%) scale(1.14); }
.result-actions { margin-bottom: 6px; }
.result-note { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ---------- Sådan virker det ---------- */
.how { max-width: 1020px; margin: 70px auto 0; padding: 0 24px; }
.how h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; text-align: center; margin-bottom: 34px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.step-num { width: 36px; height: 36px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.step h4 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 15px; }

.grid-fact {
    margin: 26px auto 0; max-width: 760px;
    background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: 10px;
    padding: 18px 22px; color: #1c2b53; font-size: 15px;
}
.grid-fact strong { color: var(--blue-dark); }

/* ---------- Faner ---------- */
.tabs {
    max-width: 1120px; margin: 26px auto 0; padding: 0 24px;
    display: flex; gap: 8px;
}
.tab {
    border: 1px solid var(--border); border-bottom: none; background: var(--soft);
    padding: 12px 22px; font-size: 15px; font-weight: 700; color: var(--muted);
    cursor: pointer; border-radius: 12px 12px 0 0; transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--blue); background: #fff; border-color: var(--border); position: relative; }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--blue); border-radius: 3px 3px 0 0; }
.tabs + .tabpanel, .tabpanel { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* trækker faneblads-linjen sammen med indholdet */
.tabpanel > .tool, .tabpanel > .planner { border-top: 1px solid var(--border); padding-top: 28px; }

/* ---------- Feed-planner ---------- */
.planner {
    max-width: 1120px; margin: 0 auto; padding: 0 24px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start;
}
@media (max-width: 880px) { .planner { grid-template-columns: 1fr; } }

.upload-multi {
    border: 2px dashed #c9d6f5; box-shadow: none; text-align: center; cursor: pointer;
    padding: 34px 22px; transition: border-color .2s, background .2s;
}
.upload-multi.dragover { border-color: var(--blue); background: var(--blue-soft); }
.up-ico { font-size: 30px; }
.up-title { font-weight: 700; margin-top: 8px; }
.up-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }

.planner-listhead { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; font-size: 14px; color: var(--muted); }
.planner-list { display: flex; flex-direction: column; gap: 10px; }
.plist-item { display: flex; align-items: center; gap: 14px; background: var(--soft); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.plist-thumb { width: 42px; height: 56px; border-radius: 6px; object-fit: cover; background: #e6e6ea; flex: none; }
.plist-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plist-meta strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist-meta span { font-size: 12px; color: var(--muted); }

.planner-right .fp-title { font-size: 19px; margin-bottom: 6px; }
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 16px 0; background: #fff; }
.fcell { position: relative; aspect-ratio: 3 / 4; background: #f0f0f3; border-radius: 4px; overflow: hidden; }
.fcell.filled { cursor: grab; }
.fcell.filled.selected { cursor: default; outline: 3px solid var(--blue); outline-offset: -3px; z-index: 2; }
.fcell.dragging { opacity: .4; }
.fcell.drop-target { outline: 3px dashed var(--blue); outline-offset: -3px; }
.fcell-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.fcell.selected .fcell-canvas { cursor: grab; }
.fc-slot { position: absolute; top: 5px; left: 5px; background: rgba(22,22,22,.75); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.fc-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(22,22,22,.7); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fc-remove:hover { background: #da0404; }
.fcell.empty { display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px dashed var(--border); }
.fcell.empty:hover { background: var(--blue-soft); border-color: var(--blue); }
.fc-plus { font-size: 30px; color: #b9bcc6; font-weight: 300; }

.fp-zoom { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.fp-zoom .zoom-lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.fp-zoom input[type=range] { flex: 1; accent-color: var(--blue); }

/* ---------- Footer ---------- */
.footer { margin-top: 70px; border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: 14px; padding: 32px 24px; }
