/**
 * Suji Core Common — Design Tokens, Header Auth Bar, Custom Dropdowns, Modals & Toasts
 */

:root {
    --sc-brand: #80141b;
    --sc-brand-soft: rgba(128, 20, 27, 0.08);
    --sc-gold: #c9a26a;
    --sc-gold-dark: #a8874d;
    --sc-bg: #faf7f2;
    --sc-surface: #ffffff;
    --sc-text: #1f2937;
    --sc-text-muted: #64748b;
    --sc-border: #e7dfd5;
    --sc-radius: 12px;
    --sc-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --sc-font-serif: 'Cormorant Garamond', Georgia, serif;
}

.sc-app-body {
    margin: 0;
    padding: 0;
    font-family: var(--sc-font-sans);
    background: var(--sc-bg);
    color: var(--sc-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.sc-app-body *,
.sc-app-body *::before,
.sc-app-body *::after {
    box-sizing: border-box;
}

/* ============================================================
   1. HEADER ACCOUNT BAR (INJECTED ON LEFT OF SUJI SITE HEADER)
   ============================================================ */
.suji-site-header__top-inner .sc-header-auth {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
}

.sc-header-auth {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sc-font-sans);
}

.sc-ha-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.sc-ha-btn--ghost {
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.sc-ha-btn--ghost:hover {
    background: #ffffff;
    border-color: var(--sc-brand);
    color: var(--sc-brand);
}

.sc-ha-btn--primary {
    color: #ffffff !important;
    background: var(--sc-brand);
    border: 1px solid var(--sc-brand);
    box-shadow: 0 2px 8px rgba(128, 20, 27, 0.22);
}

.sc-ha-btn--primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* Account Dropdown */
.sc-ha-dropdown {
    position: relative;
}

.sc-ha-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 3px 10px 3px 4px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    transition: all 0.18s ease;
}

.sc-ha-avatar-btn:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.sc-ha-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sc-brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.sc-ha-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-ha-chevron {
    color: #64748b;
    transition: transform 0.2s ease;
}

.sc-ha-dropdown.is-open .sc-ha-chevron {
    transform: rotate(180deg);
}

.sc-ha-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 224px;
    background: #ffffff;
    border: 1px solid #e7dfd5;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transition: all 0.16s ease;
    z-index: 1200;
    text-align: left;
}

.sc-appbar__right .sc-ha-menu {
    left: auto;
    right: 0;
}

.sc-ha-dropdown.is-open .sc-ha-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.sc-ha-menu__head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.sc-ha-menu__head strong {
    display: block;
    font-size: 13.5px;
    color: #0f172a;
}

.sc-ha-menu__head span {
    display: block;
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-ha-menu__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #334155 !important;
    text-decoration: none !important;
    transition: background 0.14s ease;
}

.sc-ha-menu__item:hover {
    background: #faf7f2;
    color: var(--sc-brand) !important;
}

.sc-ha-menu__item--danger {
    color: #dc2626 !important;
}

.sc-ha-menu__item--danger:hover {
    background: #fef2f2;
}

.sc-ha-menu__sep {
    height: 1px;
    background: #f1f5f9;
    margin: 5px 4px;
}

/* Modal CTA button injected into Suji preview modal */
.sc-preview-modal-use-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--sc-brand, #80141b);
    color: #ffffff !important;
    font-family: var(--sc-font-sans);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(128, 20, 27, 0.24);
}

.sc-preview-modal-use-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* ============================================================
   2. SHARED BUTTONS & ALERTS
   ============================================================ */
.sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.16s ease;
    line-height: 1.2;
}

.sc-btn:active { transform: scale(0.98); }
.sc-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.sc-btn--primary {
    background: var(--sc-brand);
    color: #fff;
    box-shadow: 0 3px 12px rgba(128, 20, 27, 0.2);
}
.sc-btn--primary:hover { filter: brightness(1.08); color: #fff; }

.sc-btn--outline {
    background: #fff;
    color: var(--sc-brand);
    border-color: rgba(128, 20, 27, 0.35);
}
.sc-btn--outline:hover {
    background: var(--sc-brand-soft);
    border-color: var(--sc-brand);
}

.sc-btn--ghost {
    background: #f1f5f9;
    color: #334155;
    border-color: transparent;
}
.sc-btn--ghost:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.sc-btn--danger {
    background: #dc2626;
    color: #fff;
}
.sc-btn--danger:hover { background: #b91c1c; }

.sc-btn--danger-ghost {
    background: #fef2f2;
    color: #dc2626;
}
.sc-btn--danger-ghost:hover {
    background: #fee2e2;
}

.sc-btn--dashed {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 1.5px dashed #cbd5e1;
    color: #334155;
}
.sc-btn--dashed:hover {
    border-color: var(--sc-brand);
    color: var(--sc-brand);
    background: #fffafa;
}

.sc-btn--lg { padding: 12px 24px; font-size: 14.5px; }
.sc-btn--sm { padding: 8px 13px; font-size: 12.5px; border-radius: 8px; }
.sc-btn--xs { padding: 6px 10px; font-size: 12px; border-radius: 7px; }

.sc-sc-notice {
    padding: 18px 22px;
    background: #faf7f2;
    border: 1px solid #e7dfd5;
    border-radius: 12px;
    font-family: var(--sc-font-sans);
    font-size: 14px;
}

.sc-sc-notice a {
    color: var(--sc-brand);
    font-weight: 700;
}

/* ============================================================
   3. CUSTOM DROPDOWN UI (RULE #7 — ZERO BROWSER-DEFAULT SELECT)
   ============================================================ */
.sc-cselect {
    position: relative;
    width: 100%;
}

.sc-cselect__native {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.sc-cselect__trigger {
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.sc-cselect__trigger:hover {
    border-color: #cbd5e1;
}

.sc-cselect.is-open .sc-cselect__trigger,
.sc-cselect__trigger:focus-visible {
    outline: none;
    border-color: var(--sc-brand);
    box-shadow: 0 0 0 3px rgba(128, 20, 27, 0.14);
}

.sc-cselect__value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-cselect__arrow {
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.sc-cselect.is-open .sc-cselect__arrow {
    transform: rotate(180deg);
    color: var(--sc-brand);
}

.sc-cselect__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e7dfd5;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 16px 38px -8px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 9500;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.sc-cselect.is-dropup .sc-cselect__menu {
    top: auto;
    bottom: calc(100% + 6px);
    transform: translateY(6px) scale(0.98);
}

.sc-cselect.is-open .sc-cselect__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.sc-cselect__opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: background 0.12s ease;
}

.sc-cselect__opt:hover,
.sc-cselect__opt.is-focused {
    background: #faf7f2;
    color: #0f172a;
}

.sc-cselect__opt.is-selected {
    background: rgba(128, 20, 27, 0.08);
    color: var(--sc-brand);
    font-weight: 600;
}

.sc-cselect__check {
    color: var(--sc-brand);
    font-weight: 700;
    opacity: 0;
    flex-shrink: 0;
}

.sc-cselect__opt.is-selected .sc-cselect__check {
    opacity: 1;
}

/* ============================================================
   4. TOAST NOTIFICATIONS
   ============================================================ */
.sc-toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: calc(100vw - 40px);
}

.sc-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: var(--sc-font-sans);
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    background: #1e293b;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
    animation: scToastIn 0.2s ease;
}

.sc-toast--success { background: #059669; }
.sc-toast--error { background: #dc2626; }

@keyframes scToastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .suji-site-header__top-inner .sc-header-auth {
        left: 10px;
    }
    .sc-ha-hide-sm,
    .sc-ha-name,
    .sc-ha-chevron {
        display: none !important;
    }
    .sc-ha-avatar-btn {
        padding: 3px;
        height: 34px;
    }
    .sc-ha-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 12px;
    }
}
