/* EYOC 2027 — CMS admin theme */
:root {
    --forest:   #0e3a2b;
    --forest-2: #0a2a1f;
    --magenta:  #e6007e;
    --magenta-700: #c2006a;
    --paper:    #f4f6f4;
    --ink:      #14201a;
    --ink-soft: #5a6b62;
    --line:     #e3e6e2;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
* { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--ink); }

.brand-mark {
    width: 22px; height: 22px; border-radius: 5px;
    background: linear-gradient(135deg, #fff 49.5%, transparent 49.5%), var(--magenta);
    flex: 0 0 auto;
}

/* ---- Login ------------------------------------------------------------ */
.login-body {
    min-height: 100vh; margin: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(120% 120% at 80% 0%, #15523c, var(--forest) 50%, var(--forest-2));
    padding: 1.5rem;
}
.login-card {
    background: #fff; border-radius: 20px; padding: 2.6rem;
    width: 100%; max-width: 400px;
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
    animation: pop 360ms var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.login-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; margin-bottom: 1.6rem; font-family: 'Space Grotesk', sans-serif; }
.login-card h1 { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; margin: 0 0 .3rem; }
.login-sub { color: var(--ink-soft); margin-bottom: 1.5rem; }
.login-back { display: inline-block; margin-top: 1.2rem; color: var(--ink-soft); text-decoration: none; font-size: .9rem; }
.login-back:hover { color: var(--magenta); }

/* ---- Layout ----------------------------------------------------------- */
.admin-body { margin: 0; background: var(--paper); height: 100vh; overflow: hidden; }
.admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 250px;
    background: var(--forest-2); color: #fff;
    display: flex; flex-direction: column; padding: 1.6rem 1.2rem;
    overflow-y: auto;            /* scroll the nav if it is taller than the screen */
    z-index: 1040;
}
.admin-brand { display: flex; align-items: center; gap: .6rem; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.15rem; margin-bottom: 2rem; }
.admin-brand small { color: var(--magenta); font-weight: 600; }
.admin-nav { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 auto; }
.admin-nav a {
    color: rgba(255,255,255,.72); text-decoration: none; font-weight: 500;
    padding: .7rem .9rem; border-radius: 10px;
    transition: background 180ms var(--ease-out), color 180ms var(--ease-out);
}
.admin-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a.active { background: var(--magenta); color: #fff; }
.admin-sidebar-foot { display: flex; flex-direction: column; gap: .5rem; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1rem; }
.admin-view-site, .admin-logout { color: rgba(255,255,255,.7); text-decoration: none; font-size: .9rem; padding: .4rem .9rem; }
.admin-view-site:hover { color: #fff; }
.admin-logout:hover { color: var(--magenta); }

.admin-main { margin-left: 250px; height: 100vh; display: flex; flex-direction: column; }
.admin-topbar {
    flex: 0 0 auto;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 1rem 1.8rem; display: flex; align-items: center; gap: 1rem;
    z-index: 1030;
}
.admin-page-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; margin: 0; }
.admin-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1.8rem; }
.admin-inner { max-width: 1000px; }
.admin-intro { color: var(--ink-soft); }

.admin-burger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; padding: .3rem; }
.admin-burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---- Panels & cards --------------------------------------------------- */
.admin-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem; margin-bottom: 1.4rem; }
.admin-panel h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; margin: 0 0 1.2rem; }
.admin-help { color: var(--ink-soft); line-height: 1.9; padding-left: 1.1rem; }

.stat-card {
    display: flex; flex-direction: column; gap: .2rem;
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    padding: 1.5rem; text-decoration: none; color: var(--ink);
    transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 220ms var(--ease-out);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(14,32,26,.1); border-color: transparent; color: var(--ink); }
.stat-num { font-family: 'Space Grotesk', sans-serif; font-size: 2.4rem; font-weight: 700; color: var(--magenta); line-height: 1; }
.stat-label { color: var(--ink-soft); font-weight: 500; }

.item-panel { position: relative; }
.delete-form { position: absolute; top: 1.6rem; right: 1.6rem; }

/* ---- Forms ------------------------------------------------------------ */
.form-label { font-weight: 600; font-size: .88rem; }
.form-control:focus { border-color: var(--magenta); box-shadow: 0 0 0 .2rem rgba(230,0,126,.12); }

.btn-eyoc {
    background: var(--magenta); color: #fff; border: 0; font-weight: 600; border-radius: 10px;
    padding: .6rem 1.3rem;
    transition: transform 150ms var(--ease-out), background 180ms var(--ease-out);
}
.btn-eyoc:hover { background: var(--magenta-700); color: #fff; }
.btn-eyoc:active { transform: scale(.97); }
.btn-eyoc.btn-sm { padding: .4rem .9rem; }

/* Bulletin → PDF action, sits under the save row */
.pdf-form {
    display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
    margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line);
}
.btn-pdf {
    background: #fff; color: var(--forest); border: 1.5px solid var(--line); border-radius: 10px;
    font-weight: 600; padding: .4rem .9rem; white-space: nowrap;
    transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 140ms var(--ease-out);
}
.btn-pdf:hover { border-color: var(--magenta); color: var(--magenta); }
.btn-pdf:active { transform: scale(.97); }
.pdf-hint { flex: 1 1 260px; color: var(--ink-soft); font-size: .84rem; line-height: 1.5; }
.pdf-hint a { color: var(--magenta); }

.btn-delete {
    background: transparent; color: #c0392b; border: 1.5px solid rgba(192,57,43,.3); border-radius: 10px; font-weight: 600;
    transition: background 180ms var(--ease-out), transform 150ms var(--ease-out);
}
.btn-delete:hover { background: rgba(192,57,43,.08); color: #c0392b; }
.btn-delete:active { transform: scale(.97); }

/* WYSIWYG (Quill) */
.richtext-editor { min-height: 200px; background: #fff; }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--line); }
.ql-toolbar.ql-snow { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.ql-container.ql-snow { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; font-family: 'Inter', sans-serif; font-size: 1rem; }
.ql-editor { min-height: 200px; }
.ql-snow .ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button:hover .ql-stroke { stroke: var(--magenta); }
.ql-snow .ql-toolbar button.ql-active .ql-stroke { stroke: var(--magenta); }

.rte-actions { margin-top: .6rem; }
.btn-rte {
    background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
    padding: .45rem .9rem; font-weight: 600; font-size: .9rem; color: var(--ink); cursor: pointer;
    transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 140ms var(--ease-out);
}
.btn-rte:hover { border-color: var(--magenta); color: var(--magenta); }
.btn-rte:active { transform: scale(.97); }

/* Media library modal */
.media-upload { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.media-hint { color: var(--ink-soft); font-size: .85rem; }
.media-status { font-size: .85rem; color: var(--magenta); font-weight: 600; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.media-loading { grid-column: 1 / -1; color: var(--ink-soft); margin: .5rem 0; }
.media-item {
    position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
    background: #fff; transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.media-item:hover { border-color: var(--magenta); box-shadow: 0 6px 16px rgba(14,32,26,.10); }
.media-thumb { display: block; height: 96px; background-size: cover; background-position: center; background-color: var(--paper); cursor: pointer; }
.media-thumb-file { display: flex; align-items: center; justify-content: center; }
.media-ext { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--magenta); letter-spacing: .04em; }
.media-name { display: block; padding: .5rem .6rem; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.media-del {
    position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; line-height: 1;
    border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
    transition: background 160ms var(--ease-out);
}
.media-del:hover { background: #c0392b; }

.current-file { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; flex-wrap: wrap; }
.current-thumb { width: 90px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.current-link { font-weight: 500; }
.remove-check { font-size: .85rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: .35rem; }

/* ---- Alerts ----------------------------------------------------------- */
.alert-eyoc { border-radius: 10px; padding: .85rem 1.1rem; margin-bottom: 1.2rem; font-weight: 500; }
.alert-eyoc-success { background: #e6f6ee; color: #0e7a48; border: 1px solid #b8e6cd; }
.alert-eyoc-error { background: #fdeaea; color: #c0392b; border: 1px solid #f3c2bd; }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 860px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform 280ms var(--ease-out); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-burger { display: flex; }
    .delete-form { position: static; margin-top: .8rem; }
}
