/* ==========================================================================
   Ježíšek — shared application styles
   Single source of truth for design tokens and component styling.
   Loaded on every page from templates/_base.html.
   Page-specific styling for the public landing page lives in landing.css.
   ========================================================================== */

:root {
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --color-primary: #de2f32;
    --color-primary-dark: #c62828;
    --color-primary-soft: #fdeeee;
    --color-text-main: #1e293b;
    --color-text-muted: #64748b;
    --color-line: #e2e8f0;
    --color-line-soft: #f1f5f9;
    --shadow-sm: 0 1px 3px 0 rgb(15 23 42 / 0.06), 0 1px 2px -1px rgb(15 23 42 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.08), 0 2px 4px -2px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

/* ---- Base ---- */
body {
    font-family: var(--font-sans);
    color: var(--color-text-main);
    background-color: #f8fafc;
    background-image: radial-gradient(circle at 100% 0%, #fff1f2 0%, transparent 30%),
                      radial-gradient(circle at 0% 100%, #f0f9ff 0%, transparent 30%);
    background-attachment: fixed;
    min-height: 100vh;
    padding-bottom: 4rem;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Bootstrap primary colour overrides (theme red) */
.text-primary {
    color: var(--color-primary) !important;
}
.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ---- Navbar ---- */
.app-navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-line);
    padding: 0.6rem 0;
    margin-bottom: 1.5rem;
}
.app-brand {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.app-brand:hover, .app-brand:focus {
    color: var(--color-text-main);
}
.app-brand i {
    color: var(--color-primary);
}
.app-navbar .navbar-nav {
    gap: 0.25rem;
}
.app-navbar .nav-link {
    color: #475569;
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.45rem 0.85rem;
}
.app-navbar .nav-link:hover {
    color: var(--color-text-main);
    background: var(--color-line-soft);
}
.app-navbar .nav-link.active {
    color: var(--color-primary-dark);
    background: var(--color-primary-soft);
}
.dropdown-menu {
    border: 1px solid var(--color-line);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    padding: 0.4rem;
}
.dropdown-item {
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

/* ---- Cards ---- */
.card {
    --bs-card-border-radius: var(--radius-lg);
    --bs-card-inner-border-radius: calc(var(--radius-lg) - 1px);
    --bs-card-border-color: rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: #fff;
    border-bottom-color: var(--color-line-soft);
}

/* ---- Buttons ---- */
.btn {
    font-weight: 600;
    border-radius: 0.65rem;
    transition: all 0.15s ease;
}
.btn-primary {
    --bs-btn-bg: var(--color-primary);
    --bs-btn-border-color: var(--color-primary);
    --bs-btn-hover-bg: var(--color-primary-dark);
    --bs-btn-hover-border-color: var(--color-primary-dark);
    --bs-btn-active-bg: #b02525;
    --bs-btn-active-border-color: #b02525;
    --bs-btn-disabled-bg: var(--color-primary);
    --bs-btn-disabled-border-color: var(--color-primary);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(222, 47, 50, 0.25);
}
.btn-success {
    --bs-btn-bg: #16a34a;
    --bs-btn-border-color: #16a34a;
    --bs-btn-hover-bg: #15803d;
    --bs-btn-hover-border-color: #15803d;
    --bs-btn-active-bg: #166534;
    --bs-btn-active-border-color: #166534;
}
.btn-outline-secondary {
    --bs-btn-color: #475569;
    --bs-btn-border-color: #cbd5e1;
    --bs-btn-hover-color: var(--color-text-main);
    --bs-btn-hover-bg: var(--color-line-soft);
    --bs-btn-hover-border-color: #cbd5e1;
    --bs-btn-active-color: var(--color-text-main);
    --bs-btn-active-bg: var(--color-line);
    --bs-btn-active-border-color: #cbd5e1;
}
.btn-watch {
    color: var(--color-text-muted);
    background: #fff;
    border: 1px solid #cbd5e1;
}
.btn-watch:hover {
    color: var(--color-text-main);
    background: var(--color-line-soft);
    border-color: #cbd5e1;
}
.btn-watch.watching {
    color: var(--color-primary-dark);
    background: var(--color-primary-soft);
    border-color: #f3c5c5;
}
.btn-watch.watching:hover {
    background: #fbdddd;
    color: var(--color-primary-dark);
    border-color: #f3c5c5;
}

/* ---- Forms ---- */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
}
.form-control {
    border-radius: 0.65rem;
    border-color: var(--color-line);
    padding: 0.6rem 0.9rem;
}
.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(222, 47, 50, 0.1);
}

/* ---- Shared bits ---- */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}
.page-title {
    font-size: 1.6rem;
    margin: 0;
}
.badge-soft {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    font-weight: 600;
}
.badge-slate {
    background: var(--color-line-soft);
    color: var(--color-text-muted);
    font-weight: 600;
}
.collapse-toggle .chev {
    transition: transform 0.2s ease;
    color: #94a3b8;
}
.collapse-toggle[aria-expanded="true"] .chev {
    transform: rotate(180deg);
}
.empty-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}
.markdown-note {
    background: var(--color-line-soft);
    border-radius: 0.75rem;
    padding: 0.9rem 1.1rem;
}
.markdown-note :last-child {
    margin-bottom: 0;
}
@media (prefers-reduced-motion: reduce) {
    .btn, .collapse-toggle .chev {
        transition: none;
    }
    .btn-primary:hover {
        transform: none;
    }
}

/* ==========================================================================
   Auth pages (login / register / password reset)
   Applied when <body class="auth-page">.
   ========================================================================== */
body.auth-page {
    background-image: radial-gradient(circle at 100% 0%, #fff1f2 0%, transparent 25%),
                      radial-gradient(circle at 0% 100%, #f0f9ff 0%, transparent 25%);
    background-attachment: initial;
    display: flex;
    align-items: center;
    padding-bottom: 0 !important;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.auth-logo {
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--color-text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}
.auth-logo i {
    color: var(--color-primary);
}
.auth-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 2.5rem;
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}
.auth-subtitle {
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}
.btn-auth-primary {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 0.75rem;
    font-weight: 600;
    width: 100%;
    margin-top: 1rem;
    transition: all 0.2s;
}
.btn-auth-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(222, 47, 50, 0.2);
    color: white;
}
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.auth-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-link:hover {
    text-decoration: underline;
}
.auth-card .alert {
    border-radius: 0.75rem;
    font-size: 0.9rem;
    border: none;
}

/* ==========================================================================
   Page-scoped helpers (wishes list, groups)
   ========================================================================== */

/* index.html — group wishes grouped by person */
.person-card {
    overflow: hidden;
}
.person-toggle {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.9rem 1.25rem;
    background: none;
    border: 0;
    border-radius: var(--radius-lg);
    text-align: left;
}
.person-toggle:hover {
    background: #fafbfc;
}
.person-toggle[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 1px solid var(--color-line-soft);
}
.person-name {
    font-weight: 600;
    font-size: 1.05rem;
    min-width: 0;
    overflow-wrap: anywhere;
}
/* index list rows are padded, hoverable list-group items inside a person card;
   on my.html / giving.html .wish-row is only a flex container inside a card body */
.person-card .wish-row {
    padding: 1rem 1.25rem;
}
.person-card .wish-row:hover {
    background: #fafbfc;
}
.wish-row h6,
.wish-row p {
    overflow-wrap: anywhere;
}

/* groups.html — group + member layout */
.group-name {
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    overflow-wrap: anywhere;
}
.group-name i {
    color: var(--color-text-muted);
}
.member-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    flex-wrap: wrap;
}
.member-row + .member-row {
    border-top: 1px solid var(--color-line-soft);
}
.note-editor summary {
    list-style: none;
    display: inline-block;
    cursor: pointer;
}
.note-editor summary::-webkit-details-marker {
    display: none;
}

/* ---- Cookie consent banner ---- */
.cookie-consent {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    max-width: 640px;
    margin: 0 auto;
}
.cookie-consent-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.cookie-consent-text {
    margin: 0;
    flex: 1 1 260px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.cookie-consent-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
