/* style.css — Kuchařka */

:root {
    --bg: #0b0e14;
    --bg-elev: #11151d;
    --surface: #151a23;
    --surface-2: #1c222d;
    --border: #262d3a;
    --border-strong: #313a4d;
    --text: #e6edf3;
    --text-muted: #8b93a7;
    --primary: #4f8cff;
    --primary-hover: #6fa0ff;
    --primary-soft: rgba(79, 140, 255, .15);
    --success: #2ea043;
    --danger: #e5484d;
    --warning: #e0a43a;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
}

html, body {
    background-color: var(--bg) !important;
    color: var(--text) !important;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
    letter-spacing: -0.01em;
    font-weight: 700;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------- Navbar ---------- */
.site-navbar {
    background: rgba(17, 21, 29, .85) !important;
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.site-navbar .navbar-brand { color: var(--text) !important; font-size: 1.15rem; }
.site-navbar .brand-mark {
    display: inline-flex;
    width: 32px; height: 32px;
    align-items: center; justify-content: center;
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
}

/* ---------- Cards ---------- */
.card {
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text) !important;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Recipe cards on index */
.row.g-4 > [class*="col-"] > .card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    overflow: hidden;
}
.row.g-4 > [class*="col-"] > .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong) !important;
}

/* ---------- Forms ---------- */
input, textarea, select,
.form-control, .form-select {
    background-color: var(--bg-elev) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
}
.form-control::placeholder { color: var(--text-muted) !important; }

input:focus, textarea:focus, select:focus,
.form-control:focus, .form-select:focus {
    background-color: var(--surface-2) !important;
    border-color: var(--primary) !important;
    color: var(--text) !important;
    box-shadow: 0 0 0 3px var(--primary-soft) !important;
    outline: none;
}

.form-label { color: var(--text); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
    letter-spacing: .01em;
    padding: .55rem 1.1rem;
    transition: all .15s ease;
    border: 1px solid transparent;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--primary-soft) !important; }

.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 140, 255, .35);
}

.btn-danger {
    background-color: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}
.btn-warning {
    background-color: var(--warning) !important;
    border-color: var(--warning) !important;
    color: #1a1a1a !important;
}

.btn-outline-secondary, .btn-outline-light {
    background: transparent !important;
    border-color: var(--border-strong) !important;
    color: var(--text) !important;
}
.btn-outline-secondary:hover, .btn-outline-light:hover {
    background-color: var(--surface-2) !important;
    border-color: var(--primary) !important;
    color: var(--text) !important;
}

.btn-outline-danger {
    background: transparent !important;
    border-color: rgba(229, 72, 77, .5) !important;
    color: var(--danger) !important;
}
.btn-outline-danger:hover {
    background-color: rgba(229, 72, 77, .15) !important;
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

/* ---------- Input group / button group chaining ----------
   Bootstrap chains adjacent .form-control / .input-group-text / .btn so the
   inner edges are square and only the outermost corners are rounded. Our
   global .btn / .form-control radius rules use !important and break that —
   restore the chained look here. */

.input-group-text {
    background-color: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 500;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text,
.input-group > .btn {
    border-radius: 0 !important;
}
.input-group > :first-child {
    border-top-left-radius: var(--radius-sm) !important;
    border-bottom-left-radius: var(--radius-sm) !important;
}
.input-group > :last-child {
    border-top-right-radius: var(--radius-sm) !important;
    border-bottom-right-radius: var(--radius-sm) !important;
}
.input-group > :not(:last-child) { border-right: 0 !important; }

.btn-group > .btn,
.btn-group > .btn-check + .btn {
    border-radius: 0 !important;
}
.btn-group > .btn:first-child,
.btn-group > .btn-check:first-child + .btn {
    border-top-left-radius: var(--radius-sm) !important;
    border-bottom-left-radius: var(--radius-sm) !important;
}
.btn-group > .btn:last-child,
.btn-group > .btn-check:last-of-type + .btn {
    border-top-right-radius: var(--radius-sm) !important;
    border-bottom-right-radius: var(--radius-sm) !important;
}

/* btn-check (radio toggle group) — fix outline-primary/success appearance */
.btn-check + .btn-outline-primary {
    color: var(--text) !important;
    border-color: var(--border-strong) !important;
    background: transparent !important;
}
.btn-check:checked + .btn-outline-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.btn-check + .btn-outline-success {
    color: var(--text) !important;
    border-color: var(--border-strong) !important;
    background: transparent !important;
}
.btn-check:checked + .btn-outline-success {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}

/* ---------- Filter bar ---------- */
.filter-bar {
    position: sticky;
    top: 76px;
    z-index: 5;
    background: rgba(21, 26, 35, .82);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    box-shadow: var(--shadow-sm);
}
.filter-form { flex: 1 1 auto; min-width: 0; }
.filter-form .form-control,
.filter-form .form-select { min-width: 140px; }

@media (max-width: 768px) {
    .filter-bar { top: 0; border-radius: var(--radius-sm); }
    .filter-form { width: 100%; }
    .filter-form .form-control,
    .filter-form .form-select,
    .filter-form .btn { width: 100%; }
}

/* ---------- Recipe image ---------- */
.recipe-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    height: auto;
    object-fit: cover;
    object-position: center;
    background: var(--surface-2);
}

/* ---------- Badges ---------- */
.badge {
    border-radius: var(--radius-pill);
    font-weight: 600;
    padding: .4em .75em;
    letter-spacing: .01em;
}

/* ---------- Switches ---------- */
.form-check-input {
    background-color: var(--surface-2) !important;
    border: 1px solid var(--border-strong) !important;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}
.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}
.form-check-input.toggle-fit:checked {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
}
.form-check-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-soft) !important;
}

/* ---------- Misc ---------- */
.text-muted { color: var(--text-muted) !important; }
.list-group-item {
    background: transparent !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
hr { border-color: var(--border) !important; }

.alert-info {
    background-color: rgba(79, 140, 255, .12) !important;
    border: 1px solid rgba(79, 140, 255, .35) !important;
    color: var(--text) !important;
}
.alert-success {
    background-color: rgba(46, 160, 67, .12) !important;
    border: 1px solid rgba(46, 160, 67, .4) !important;
    color: #b6ecc1 !important;
}
.alert-danger {
    background-color: rgba(229, 72, 77, .12) !important;
    border: 1px solid rgba(229, 72, 77, .4) !important;
    color: #f5a9ac !important;
}
.alert-warning {
    background-color: rgba(224, 164, 58, .12) !important;
    border: 1px solid rgba(224, 164, 58, .4) !important;
    color: #f0d39a !important;
}

/* ---------- Tables ---------- */
.table {
    color: var(--text) !important;
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-striped-bg: rgba(255, 255, 255, .025);
    --bs-table-striped-color: var(--text);
    --bs-table-border-color: var(--border);
}
.table > :not(caption) > * > * {
    background-color: transparent !important;
    color: var(--text) !important;
    border-bottom-color: var(--border) !important;
}
.table thead th {
    color: var(--text-muted) !important;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border-strong) !important;
}

/* ---------- Modal ---------- */
.modal-content {
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius);
}
.modal-header, .modal-footer { border-color: var(--border) !important; }

/* ---------- Empty state ---------- */
.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
}
.empty-state .empty-icon {
    font-size: 3rem;
    opacity: .6;
}

/* ---------- Pagination ---------- */
.pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.page-item:first-child .page-link,
.page-item:last-child .page-link,
.page-item .page-link {
    border-radius: var(--radius-sm) !important;
    margin: 0 !important;
}
.page-item .page-link {
    background-color: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all .18s ease;
}
.page-item.active .page-link {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(79, 140, 255, .35);
    transform: translateY(-1px);
}
.page-item .page-link:hover {
    background-color: var(--surface) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    transform: translateY(-1px);
}
.page-item.disabled .page-link {
    background-color: var(--bg-elev) !important;
    color: #484f58 !important;
    border-color: var(--border) !important;
    cursor: default;
    transform: none !important;
}

/* ---------- Reusable utility classes (replacing inline styles) ---------- */
.avatar-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.recipe-body { min-height: 200px; }
.form-narrow { max-width: 600px; margin: 0 auto; }
.scroll-200 { max-height: 200px; overflow-y: auto; }

/* ---------- Admin sub-navigation ---------- */
.admin-subnav { flex-wrap: wrap; }
.admin-subnav .btn { white-space: nowrap; }

/* ---------- Dashboard stat cards ---------- */
.stat-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1rem;
    text-align: center;
    color: var(--text);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    text-decoration: none;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
    color: var(--text);
}
.stat-card .stat-icon { font-size: 1.7rem; opacity: .9; }
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: .25rem;
    color: var(--text);
}
.stat-card .stat-label {
    font-size: .8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: .25rem;
}

/* ---------- CMS content rendering (markdown output) ---------- */
.cms-content { line-height: 1.75; font-size: 1.05rem; }
.cms-content h1,
.cms-content h2,
.cms-content h3,
.cms-content h4 { margin-top: 1.8em; margin-bottom: .6em; letter-spacing: -.01em; }
.cms-content h1:first-child,
.cms-content h2:first-child { margin-top: 0; }
.cms-content p { margin-bottom: 1em; }
.cms-content ul,
.cms-content ol { margin-bottom: 1em; padding-left: 1.4em; }
.cms-content li { margin-bottom: .35em; }
.cms-content a { color: var(--primary); }
.cms-content a:hover { color: var(--primary-hover); text-decoration: underline; }
.cms-content code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .1em .4em;
    font-size: .9em;
}
.cms-content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}
.cms-content strong { color: #fff; }

/* ---------- Post hero + thumbnails ---------- */
.post-hero {
    width: 100%;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}
.post-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.post-card { overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* ---------- Media library thumbs ---------- */
.media-card { overflow: hidden; }
.media-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--surface-2);
}

/* ---------- Dropdown menu (admin) ---------- */
.dropdown-menu {
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.dropdown-item { color: var(--text) !important; }
.dropdown-item:hover { background-color: var(--surface-2) !important; }
