/* =========================================================================
   Salesforce Dictionary - Detail Page Styles
   ========================================================================= */

/* ── Breadcrumb ────────────────────────────────────────────────────────── */

.sf-breadcrumb {
    background: var(--sf-bg-card);
    border-bottom: 1px solid var(--sf-border-color);
    padding: 12px 24px;
}

.sf-breadcrumb__inner {
    max-width: var(--sf-max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.sf-breadcrumb__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--sf-brand-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--sf-transition);
}

.sf-breadcrumb__link:hover {
    color: var(--sf-brand-primary-hover);
}

.sf-breadcrumb__sep {
    color: var(--sf-text-tertiary);
}

.sf-breadcrumb__current {
    color: var(--sf-text-secondary);
    font-weight: 600;
}

/* ── Detail Layout ─────────────────────────────────────────────────────── */

.sf-detail {
    max-width: 1140px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 28px;
    align-items: start;
}

.sf-detail__main {
    min-width: 0;
}

.sf-detail__sidebar {
    position: sticky;
    top: 72px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sf-detail__article {
    background: var(--sf-bg-card);
    border-radius: var(--sf-border-radius);
    box-shadow: var(--sf-shadow-card);
    border: 1px solid var(--sf-border-color);
    overflow: hidden;
}

/* ── Term Header ───────────────────────────────────────────────────────── */

.sf-detail__header {
    background: linear-gradient(135deg, var(--sf-brand-dark) 0%, #063872 55%, #0a4fa3 100%);
    color: var(--sf-text-inverse);
    padding: 32px 36px;
    position: relative;
    overflow: hidden;
}

.sf-detail__header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300A1E0' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.sf-detail__header > * {
    position: relative;
    z-index: 1;
}

.sf-detail__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.sf-detail__title {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: var(--sf-text-inverse);
}

/* ── Reading Time & Meta ─────────────────────────────────────────────── */

.sf-detail__meta {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.sf-detail__reading-time {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.3px;
}

/* ── Detail Copy Button ──────────────────────────────────────────────── */

.sf-detail__copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: var(--sf-text-inverse);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sf-detail__copy-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
}

.sf-detail__copy-btn svg {
    flex-shrink: 0;
}

.sf-detail__copy-btn.sf-copied {
    background: rgba(76, 175, 80, 0.25);
    border-color: rgba(76, 175, 80, 0.5);
}

/* ── Share Buttons (Header) ───────────────────────────────────────────── */
.sf-detail__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: var(--sf-text-inverse);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}
.sf-detail__share-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}
.sf-detail__share-btn svg { flex-shrink: 0; width: 14px; height: 14px; }
.sf-detail__share-btn--linkedin:hover {
    background: rgba(10, 102, 194, 0.4);
    border-color: rgba(10, 102, 194, 0.7);
}
.sf-detail__share-btn--twitter:hover {
    background: rgba(29, 161, 242, 0.35);
    border-color: rgba(29, 161, 242, 0.7);
}
.sf-detail__share-btn--copy:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
}
.sf-detail__share-btn--copy.sf-copied {
    background: rgba(76, 175, 80, 0.35);
    border-color: rgba(76, 175, 80, 0.7);
}

.sf-detail__header .sf-term-card__badge {
    font-size: 13px;
    padding: 5px 14px;
}

/* ── Sections ──────────────────────────────────────────────────────────── */

.sf-detail__section {
    padding: 28px 36px;
    border-bottom: 1px solid var(--sf-border-color);
}

.sf-detail__section:last-child {
    border-bottom: none;
}

.sf-detail__section h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--sf-brand-dark);
    margin: 0 0 16px;
}

.sf-detail__section p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--sf-text-secondary);
    margin: 0 0 12px;
}

.sf-detail__section p:last-child {
    margin-bottom: 0;
}

.sf-detail__section ul {
    padding-left: 20px;
    margin: 0;
}

.sf-detail__section li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--sf-text-secondary);
    margin-bottom: 8px;
}

.sf-detail__section li:last-child {
    margin-bottom: 0;
}

/* ── Example Block ─────────────────────────────────────────────────────── */

.sf-detail__example {
    background: #F9FAFB;
    border-left: 4px solid var(--sf-brand-accent);
    border-radius: var(--sf-border-radius-sm);
    padding: 18px 20px;
}

.sf-detail__example p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--sf-text-tertiary);
}

/* ── Feature List ──────────────────────────────────────────────────────── */

.sf-detail__feature-list {
    list-style: none;
    padding: 0;
}

.sf-detail__feature-list li {
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: var(--sf-border-radius-sm);
    margin-bottom: 10px;
    border-left: 3px solid var(--sf-brand-primary);
}

.sf-detail__feature-list li:last-child {
    margin-bottom: 0;
}

.sf-detail__feature-list li strong {
    color: var(--sf-brand-dark);
}

/* ── Step-by-Step Guide ────────────────────────────────────────────────── */

.sf-detail__steps {
    margin-top: 20px;
}

.sf-detail__step {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    position: relative;
}

.sf-detail__step:last-child {
    margin-bottom: 0;
}

/* Vertical connector line */
.sf-detail__step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 44px;
    bottom: -24px;
    width: 2px;
    background: var(--sf-border-color);
}

.sf-detail__step-number {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--sf-brand-primary);
    color: var(--sf-text-inverse);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.sf-detail__step-content {
    flex: 1;
    padding-top: 4px;
}

.sf-detail__step-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--sf-text-primary);
    margin: 0 0 8px;
}

.sf-detail__step-content p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--sf-text-secondary);
    margin: 0 0 10px;
}

.sf-detail__step-content p:last-child {
    margin-bottom: 0;
}

.sf-detail__step-content ul {
    padding-left: 18px;
    margin: 8px 0 0;
}

.sf-detail__step-content li {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 4px;
}

/* ── Related Terms (Sidebar Widget) ───────────────────────────────────── */

.sf-detail__related-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sf-detail__related-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--sf-border-color);
}

.sf-detail__related-item:last-child {
    border-bottom: none;
}

.sf-detail__related-item strong {
    display: block;
    font-size: 13px;
    color: var(--sf-brand-dark);
    margin-bottom: 2px;
}

.sf-detail__related-item strong a:hover {
    color: var(--sf-brand-primary) !important;
}

.sf-detail__related-item p {
    font-size: 12px;
    line-height: 1.4;
    color: var(--sf-text-tertiary);
    margin: 0;
}

/* ── Pro Tips (Sidebar Widget) ────────────────────────────────────────── */

.sf-detail__sidebar-tips {
    padding: 16px;
}

.sf-detail__sidebar-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sf-detail__sidebar-tips li {
    font-size: 13px;
    line-height: 1.5;
    color: var(--sf-text-secondary);
    padding: 8px 0;
    border-bottom: 1px solid var(--sf-border-color);
}

.sf-detail__sidebar-tips li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sf-detail__sidebar-tips li:first-child {
    padding-top: 0;
}

/* ── Back Button ───────────────────────────────────────────────────────── */

.sf-detail__back {
    text-align: center;
    margin-top: 32px;
}

.sf-detail__back .sf-btn {
    padding: 12px 28px;
    font-size: 15px;
    text-decoration: none !important;
    color: #FFFFFF !important;
}

.sf-detail__back .sf-btn--primary:hover,
.sf-detail__back .sf-btn--primary:focus,
.sf-detail__back .sf-btn--primary:active,
.sf-detail__back .sf-btn--primary:visited {
    color: #FFFFFF !important;
    background: var(--sf-brand-primary-hover) !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .sf-detail {
        grid-template-columns: 1fr;
        max-width: 820px;
    }

    .sf-detail__sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .sf-detail {
        padding: 20px 16px 40px;
    }

    .sf-detail__header {
        padding: 24px 20px;
    }

    .sf-detail__title {
        font-size: 24px;
    }

    .sf-detail__section {
        padding: 20px;
    }

    .sf-detail__step-content h3 {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .sf-detail__title {
        font-size: 20px;
    }

    .sf-detail__title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .sf-detail__meta {
        margin-top: 8px;
    }
}

/* ── Dark Mode Overrides ──────────────────────────────────────────────── */

[data-theme="dark"] .sf-detail__header {
    background: linear-gradient(135deg, #0D1B2A 0%, #0F2847 55%, #122F54 100%);
}

[data-theme="dark"] .sf-detail__title {
    color: #E8F0FE;
}

[data-theme="dark"] .sf-detail__section h2 {
    color: #E8F0FE;
}

[data-theme="dark"] .sf-detail__feature-list li strong {
    color: #5EB5FF;
}

[data-theme="dark"] .sf-detail__related-item strong {
    color: #5EB5FF;
}

[data-theme="dark"] .sf-detail__example {
    background: #1C2128;
}

[data-theme="dark"] .sf-detail__feature-list li {
    background: #1C2128;
}

[data-theme="dark"] .sf-detail__related-item {
    border-color: var(--sf-border-color);
}

[data-theme="dark"] .sf-detail__related-item strong {
    color: #5EB5FF;
}

/* ── ELI5 Toggle ─────────────────────────────────────────────────────── */

.sf-detail__def-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sf-detail__def-header h2 {
    margin: 0 !important;
}

.sf-eli5-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--sf-border-color);
    background: var(--sf-bg-card);
    color: var(--sf-text-secondary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sf-eli5-toggle:hover {
    border-color: var(--sf-brand-primary);
    color: var(--sf-brand-primary);
}

.sf-eli5-toggle--active {
    background: var(--sf-brand-primary);
    color: white;
    border-color: var(--sf-brand-primary);
}

.sf-eli5-toggle--active:hover {
    background: var(--sf-brand-primary-hover);
    border-color: var(--sf-brand-primary-hover);
}

.sf-eli5-toggle__icon {
    font-size: 15px;
    line-height: 1;
}

.sf-eli5-toggle__label {
    letter-spacing: 0.3px;
}

.sf-detail__eli5-content {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFF3E0 100%);
    border-left: 4px solid #FFB74D;
    border-radius: var(--sf-border-radius-sm);
    padding: 20px 22px;
}

.sf-detail__eli5-content p {
    font-size: 15.5px;
    line-height: 1.8;
    color: #37474F;
    margin: 0;
}

/* ── ELI5 Dark Mode ──────────────────────────────────────────────────── */

[data-theme="dark"] .sf-eli5-toggle {
    background: #161B22;
    border-color: #30363D;
    color: #B1BAC4;
}

[data-theme="dark"] .sf-eli5-toggle:hover {
    border-color: #1B96FF;
    color: #1B96FF;
}

[data-theme="dark"] .sf-eli5-toggle--active {
    background: #1B96FF;
    color: #FFFFFF;
    border-color: #1B96FF;
}

[data-theme="dark"] .sf-detail__eli5-content {
    background: linear-gradient(135deg, #2D2200 0%, #2A1800 100%);
    border-left-color: #E69500;
}

[data-theme="dark"] .sf-detail__eli5-content p {
    color: #E6D5B8;
}

/* ── Difficulty Badges ────────────────────────────────────────── */

.sf-difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.sf-difficulty-badge--beginner { background: #E8F5E9; color: #2E7D32; }
.sf-difficulty-badge--intermediate { background: #FFF8E1; color: #F57F17; }
.sf-difficulty-badge--advanced { background: #FFEBEE; color: #C62828; }

[data-theme="dark"] .sf-difficulty-badge--beginner { background: #1B3D1F; color: #81C784; }
[data-theme="dark"] .sf-difficulty-badge--intermediate { background: #3D2E00; color: #FFD54F; }
[data-theme="dark"] .sf-difficulty-badge--advanced { background: #3D1414; color: #EF9A9A; }

/* ── Quiz Section ─────────────────────────────────────────────── */

.sf-quiz {
    background: var(--sf-bg-card);
    border: 1px solid var(--sf-border-color);
    border-radius: var(--sf-border-radius);
    padding: 28px 28px 20px;
    margin-top: 4px;
}
.sf-quiz__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}
.sf-quiz__header h2 { margin: 0 !important; font-size: 20px; border: none !important; padding: 0 !important; }
.sf-quiz__score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--sf-brand-light);
    color: var(--sf-brand-primary);
    font-size: 13px;
    font-weight: 600;
}
.sf-quiz__question {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--sf-border-color);
}
.sf-quiz__question:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sf-quiz__question-text {
    font-weight: 600;
    font-size: 15px;
    color: var(--sf-text-primary);
    margin-bottom: 12px;
}
.sf-quiz__choices { list-style: none; padding: 0; margin: 0; }
.sf-quiz__choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: var(--sf-border-radius-sm);
    border: 1.5px solid var(--sf-border-color);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    color: var(--sf-text-primary);
    line-height: 1.5;
}
.sf-quiz__choice:hover { border-color: var(--sf-brand-primary); background: var(--sf-brand-light); }
.sf-quiz__choice--correct {
    border-color: #4CAF50 !important;
    background: #E8F5E9 !important;
    color: #1B5E20 !important;
    cursor: default;
}
.sf-quiz__choice--wrong {
    border-color: #F44336 !important;
    background: #FFEBEE !important;
    color: #B71C1C !important;
    cursor: default;
}
.sf-quiz__choice--disabled {
    pointer-events: none;
    opacity: 0.55;
}
.sf-quiz__choice-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sf-border-color);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}
.sf-quiz__choice--correct .sf-quiz__choice-letter { background: #4CAF50; color: white; }
.sf-quiz__choice--wrong .sf-quiz__choice-letter { background: #F44336; color: white; }
.sf-quiz__explanation {
    margin-top: 10px;
    padding: 12px 16px;
    border-radius: var(--sf-border-radius-sm);
    font-size: 13.5px;
    line-height: 1.6;
    display: none;
}
.sf-quiz__explanation--correct { background: #E8F5E9; color: #1B5E20; border-left: 3px solid #4CAF50; }
.sf-quiz__explanation--wrong { background: #FFEBEE; color: #B71C1C; border-left: 3px solid #F44336; }

[data-theme="dark"] .sf-quiz__choice--correct { background: #1B3D1F !important; color: #A5D6A7 !important; border-color: #388E3C !important; }
[data-theme="dark"] .sf-quiz__choice--wrong { background: #3D1414 !important; color: #EF9A9A !important; border-color: #D32F2F !important; }
[data-theme="dark"] .sf-quiz__explanation--correct { background: #1B3D1F; color: #A5D6A7; border-left-color: #388E3C; }
[data-theme="dark"] .sf-quiz__explanation--wrong { background: #3D1414; color: #EF9A9A; border-left-color: #D32F2F; }
[data-theme="dark"] .sf-quiz__choice-letter { background: #30363D; color: #B1BAC4; }
[data-theme="dark"] .sf-quiz__choice--correct .sf-quiz__choice-letter { background: #388E3C; color: white; }
[data-theme="dark"] .sf-quiz__choice--wrong .sf-quiz__choice-letter { background: #D32F2F; color: white; }

/* ── Learning Path Link ───────────────────────────────────────── */

.sf-detail__path-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background: linear-gradient(135deg, #EEF4FF 0%, #E8F0FE 100%);
    border: 1px solid #BBDEFB;
    border-radius: var(--sf-border-radius-sm);
    margin-top: 20px;
    text-decoration: none;
    color: var(--sf-brand-primary);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}
.sf-detail__path-link:hover { background: linear-gradient(135deg, #E3ECFA 0%, #D6E4F7 100%); transform: translateX(4px); }
.sf-detail__path-link span:last-child { font-size: 18px; }

[data-theme="dark"] .sf-detail__path-link {
    background: linear-gradient(135deg, #0D1B2A 0%, #122240 100%);
    border-color: #1A3A5C;
    color: #5EB5FF;
}
[data-theme="dark"] .sf-detail__path-link:hover {
    background: linear-gradient(135deg, #122240 0%, #1A3050 100%);
}


/* ── Confetti Animation ────────────────────────────────────────── */

.sf-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.sf-confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: sf-confetti-fall 3s ease-in forwards;
}

@keyframes sf-confetti-fall {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    75% { opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

.sf-confetti-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #0176D3, #1B96FF);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 20px rgba(1, 118, 211, 0.35);
    z-index: 10000;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    white-space: nowrap;
}

.sf-confetti-toast.sf-confetti-toast--visible {
    transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] .sf-confetti-toast {
    background: linear-gradient(135deg, #1B96FF, #5EB5FF);
    color: #0D1117;
}

/* ── Suggest an Edit ──────────────────────────────────────────────────── */

.sf-suggest-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 8px;
    padding: 20px;
    background: var(--sf-bg-card);
    border: 1px dashed var(--sf-border-color);
    border-radius: 12px;
    text-align: center;
}

.sf-suggest-edit__text {
    font-size: 14px;
    color: var(--sf-text-secondary);
    margin: 0;
}

.sf-suggest-edit__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sf-brand-primary);
    background: transparent;
    border: 1.5px solid var(--sf-brand-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.sf-suggest-edit__btn:hover {
    background: var(--sf-brand-primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(1, 118, 211, 0.25);
}

.sf-suggest-edit__btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Suggest Edit Modal */
.sf-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sf-modal-overlay.sf-modal--open {
    display: flex;
}

.sf-modal {
    background: var(--sf-bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: sf-modal-in 0.25s ease-out;
}

@keyframes sf-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.sf-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--sf-border-color);
}

.sf-modal__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--sf-text-primary);
}

.sf-modal__close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--sf-text-tertiary);
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: all 0.15s ease;
}

.sf-modal__close:hover {
    background: var(--sf-bg-page);
    color: var(--sf-text-primary);
}

.sf-modal__body {
    padding: 24px;
}

.sf-modal__term-badge {
    display: inline-block;
    background: var(--sf-bg-page);
    color: var(--sf-text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.sf-modal__field {
    margin-bottom: 16px;
}

.sf-modal__field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sf-text-secondary);
    margin-bottom: 6px;
}

.sf-modal__field select,
.sf-modal__field input,
.sf-modal__field textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--sf-border-color);
    border-radius: 8px;
    background: var(--sf-bg-page);
    color: var(--sf-text-primary);
    font-family: inherit;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.sf-modal__field select:focus,
.sf-modal__field input:focus,
.sf-modal__field textarea:focus {
    outline: none;
    border-color: var(--sf-brand-primary);
    box-shadow: 0 0 0 3px rgba(1, 118, 211, 0.15);
}

.sf-modal__field textarea {
    min-height: 100px;
    resize: vertical;
}

.sf-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--sf-border-color);
}

.sf-modal__cancel {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--sf-border-color);
    border-radius: 8px;
    color: var(--sf-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sf-modal__cancel:hover {
    background: var(--sf-bg-page);
    color: var(--sf-text-primary);
}

.sf-modal__submit {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    background: var(--sf-brand-primary);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sf-modal__submit:hover {
    background: var(--sf-brand-primary-hover);
    transform: translateY(-1px);
}

.sf-modal__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.sf-modal__success {
    text-align: center;
    padding: 32px 24px;
}

.sf-modal__success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.sf-modal__success h4 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--sf-text-primary);
}

.sf-modal__success p {
    margin: 0;
    font-size: 14px;
    color: var(--sf-text-secondary);
}

@media (max-width: 600px) {
    .sf-suggest-edit {
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }

    .sf-modal {
        max-width: 100%;
    }

    .sf-modal__footer {
        flex-direction: column-reverse;
    }

    .sf-modal__footer button {
        width: 100%;
    }
}
