/* ══════════════════════════════════════════════════════════
   Layout styles — _Layout.cshtml shared components
   (lang switcher, theme toggle, cookie banner/modal, footer)
   ══════════════════════════════════════════════════════════ */

/* ── Page shell — sticky footer ─────────────────────────────
   Body is a full-height flex column so the footer
   (.mkt-footer { margin-top: auto }) is pushed to the bottom
   of the viewport on short pages. On tall pages the auto
   margin collapses to 0, so the footer sits flush with the
   content with no gap. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Lang switcher + theme toggle pill (all pages) ─────── */
.lang-switcher {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.1rem;
    background: rgba(27, 42, 59, 0.75);
    backdrop-filter: blur(6px);
    border-radius: 50px;
    padding: 0.3rem 0.6rem;
}

.lang-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 50px;
    transition: color 0.2s, background 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.lang-flag {
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0;
}

.lang-btn:hover { color: #F7B56B; }

.lang-btn--active {
    color: #E8943A;
    background: rgba(232, 148, 58, 0.15);
}

.lang-btn:focus-visible {
    outline: 2px solid #E8943A;
    outline-offset: 2px;
}

.lang-divider {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.65rem;
    line-height: 1;
    user-select: none;
}

/* Theme toggle button */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 36px;
    transition: background 0.2s;
    color: rgba(255, 255, 255, 0.7);
}

.theme-toggle-btn:hover {
    background: rgba(232, 148, 58, 0.15);
    color: #F7B56B;
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid #E8943A;
    outline-offset: 2px;
}

.theme-toggle-btn svg {
    width: 15px;
    height: 15px;
}

/* Moon shown in light mode (click → go dark); sun shown in dark mode (click → go light) */
.theme-toggle-btn .theme-icon-sun  { display: none; }
.theme-toggle-btn .theme-icon-moon { display: block; }

[data-theme="light"] .theme-toggle-btn .theme-icon-sun  { display: none; }
[data-theme="light"] .theme-toggle-btn .theme-icon-moon { display: block; }

[data-theme="dark"] .theme-toggle-btn .theme-icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle-btn .theme-icon-moon { display: none; }

/* ── Cookie consent banner ──────────────────────────────── */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #1B2A3B;
    border-top: 2px solid #E8943A;
    padding: 1.25rem 0;
    box-shadow: 0 -4px 32px rgba(27, 42, 59, 0.35);
    animation: bannerSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bannerSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-banner-inner {
    max-width: 1720px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-banner-text { flex: 1; min-width: 240px; }

.cookie-banner-title {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: #F7B56B;
    display: block;
    margin-bottom: 0.2rem;
}

#cookie-banner-desc {
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    color: rgba(168, 200, 224, 0.85);
    line-height: 1.6;
    margin: 0;
}

#cookie-banner-desc a {
    color: #6BAED6;
    font-weight: 700;
    text-decoration: none;
}

#cookie-banner-desc a:hover { color: #E8943A; }

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Shared button base ─────────────────────────────────── */
.cookie-btn {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}

.cookie-btn:focus-visible {
    outline: 2px solid #E8943A;
    outline-offset: 3px;
}

.cookie-btn-accept {
    background: #E8943A;
    color: white;
    border: 2px solid #E8943A;
    box-shadow: 0 4px 16px rgba(232, 148, 58, 0.35);
}

.cookie-btn-accept:hover {
    background: #d4782a;
    border-color: #d4782a;
    transform: translateY(-1px);
}

/* Outline style — used for Decline All & Manage Preferences */
.cookie-btn-outline {
    background: transparent;
    color: rgba(168, 200, 224, 0.9);
    border: 2px solid rgba(168, 200, 224, 0.3);
}

.cookie-btn-outline:hover {
    border-color: rgba(168, 200, 224, 0.7);
    color: white;
    transform: translateY(-1px);
}

/* ── Preferences modal overlay ──────────────────────────── */
.cookie-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(27, 42, 59, 0.65);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.cookie-modal-overlay--open {
    display: flex;
    animation: overlayFadeIn 0.25s ease both;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cookie-modal {
    background: #FFFBF5;
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 24px 64px rgba(27, 42, 59, 0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid #E8D9C4;
}

.cookie-modal-title {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.6rem;
    color: #1B2A3B;
    margin: 0;
    letter-spacing: -0.01em;
}

.cookie-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #8A7E72;
    font-size: 1rem;
    padding: 0.4rem;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-modal-close:hover {
    color: #1B2A3B;
    background: #F5ECD9;
}

.cookie-modal-close:focus-visible {
    outline: 2px solid #E8943A;
    outline-offset: 2px;
}

.cookie-modal-body {
    padding: 1.25rem 1.75rem;
}

.cookie-modal-intro {
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    color: #8A7E72;
    line-height: 1.65;
    margin: 0 0 1.25rem;
}

/* ── Cookie category rows ───────────────────────────────── */
.cookie-category {
    padding: 1rem 0;
    border-top: 1px solid #F5ECD9;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.cookie-category-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cookie-category-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.88rem;
    color: #1B2A3B;
    letter-spacing: 0.02em;
}

.cookie-category-badge {
    font-family: 'Nunito', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #E8943A;
    background: rgba(232, 148, 58, 0.1);
    border: 1px solid rgba(232, 148, 58, 0.25);
    padding: 0.15rem 0.55rem;
    border-radius: 50px;
}

.cookie-category-desc {
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    color: #8A7E72;
    line-height: 1.6;
    margin: 0;
}

/* ── Toggle switch ──────────────────────────────────────── */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #E8D9C4;
    border-radius: 13px;
    transition: background 0.22s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.cookie-toggle input:checked + .cookie-toggle-slider { background: #E8943A; }
.cookie-toggle input:checked + .cookie-toggle-slider::before { transform: translateX(20px); }

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background: #E8943A;
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle input:focus-visible + .cookie-toggle-slider {
    outline: 2px solid #E8943A;
    outline-offset: 2px;
}

/* ── Modal footer ───────────────────────────────────────── */
.cookie-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid #E8D9C4;
}

/* Override outline style inside the modal (dark on cream) */
.cookie-modal-footer .cookie-btn-outline {
    color: #1B2A3B;
    border-color: #E8D9C4;
}

.cookie-modal-footer .cookie-btn-outline:hover {
    border-color: #1B2A3B;
    color: #1B2A3B;
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
    background: linear-gradient(135deg, #1B2A3B 0%, #243647 100%);
    border-top: 2px solid #E8943A;
    padding: 1.1rem 0;
    font-family: 'Nunito', sans-serif;
}

.footer-inner {
    max-width: 1720px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.footer-brand {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: #F7B56B;
    letter-spacing: -0.01em;
}

.footer-copy {
    color: rgba(168, 200, 224, 0.7);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    flex: 1;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #6BAED6;
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #E8943A;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .cookie-banner-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .cookie-banner-actions {
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
        text-align: center;
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
        text-align: center;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .footer-copy { flex: none; }
}

/* ── Dark mode: cookie modal ────────────────────────────── */
[data-theme="dark"] .cookie-modal {
    background: #1E2D40;
}

[data-theme="dark"] .cookie-modal-header {
    border-bottom-color: #2E3F55;
}

[data-theme="dark"] .cookie-modal-title {
    color: #EDE4D8;
}

[data-theme="dark"] .cookie-modal-close {
    color: #7A8FA3;
}

[data-theme="dark"] .cookie-modal-close:hover {
    color: #EDE4D8;
    background: #253447;
}

[data-theme="dark"] .cookie-modal-intro {
    color: #7A8FA3;
}

[data-theme="dark"] .cookie-category {
    border-top-color: #253447;
}

[data-theme="dark"] .cookie-category-name {
    color: #EDE4D8;
}

[data-theme="dark"] .cookie-modal-footer {
    border-top-color: #2E3F55;
}

[data-theme="dark"] .cookie-modal-footer .cookie-btn-outline {
    color: #EDE4D8;
    border-color: #2E3F55;
}

[data-theme="dark"] .cookie-modal-footer .cookie-btn-outline:hover {
    border-color: #EDE4D8;
    color: #EDE4D8;
}

/* ── Dark mode: footer ──────────────────────────────────── */
[data-theme="dark"] .footer {
    background: linear-gradient(135deg, #070E18 0%, #0C1520 100%);
    border-top-color: rgba(240, 155, 66, 0.5);
}

[data-theme="dark"] .footer-brand {
    color: #F7B56B;
}

[data-theme="dark"] .footer-copy {
    color: rgba(123, 190, 221, 0.5);
}

[data-theme="dark"] .footer-links a {
    color: rgba(123, 190, 221, 0.6);
}

[data-theme="dark"] .footer-links a:hover {
    color: #F09B42;
}
