/**
 * ============================================================================
 * SHELF — MAIN STYLESHEET (main.css)
 * Uses variables from theme.css exclusively for consistent theming.
 * ============================================================================
 */

@import url('./theme.css?v=3');

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    color: var(--color-text-primary);
    transition: background var(--transition-base), color var(--transition-base);
}

/* App Mobile Shell */
.app-wrapper {
    width: 100%;
    max-width: var(--app-max-width);
    min-height: 100vh;
    margin: 0 auto;
    background-color: var(--color-app-bg);
    box-shadow: var(--shadow-app);
    position: relative;
    padding: 28px 22px 136px 22px;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Page Entrance Animation */
.page-content {
    animation: fadeIn 0.25s ease-out;
}

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

/* Reusable Theme-Aware Surface Cards & Inputs */
.theme-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    box-shadow: var(--shadow-card);
    transition: background-color var(--transition-base), border-color var(--transition-fast), transform var(--transition-fast);
}

/* ============================================================================
 * FORM FIELDS — redesigned inputs, textareas, selects
 * ============================================================================ */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-hint {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-top: -2px;
}

.field-error {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-brand-pink-dark);
    display: none;
    align-items: center;
    gap: 5px;
}

.field-error.show {
    display: flex;
}

.theme-input {
    width: 100%;
    background-color: var(--color-surface-muted);
    color: var(--color-text-primary);
    border: 1.5px solid var(--color-border-default);
    border-radius: var(--radius-xl);
    padding: 13px 16px;
    font-size: 0.8125rem;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color var(--transition-fast), background-color var(--transition-base), box-shadow var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.theme-input::placeholder {
    color: var(--color-text-muted);
}

.theme-input:hover {
    border-color: color-mix(in srgb, var(--color-border-default) 60%, var(--color-text-muted));
}

.theme-input:focus {
    outline: none;
    background-color: var(--color-surface);
    border-color: var(--color-brand-pink-dark);
    box-shadow: var(--focus-ring);
}

.theme-input.field-invalid {
    border-color: var(--color-brand-pink-dark);
    box-shadow: var(--focus-ring);
}

textarea.theme-input {
    resize: vertical;
    min-height: 84px;
}

.fc-input-rtl {
    direction: rtl;
    text-align: right;
    font-family: var(--font-fa);
    letter-spacing: 0;
}

.fc-input-ltr {
    direction: ltr;
    text-align: left;
    font-family: var(--font-en);
}

/* Select fields get a custom chevron that flips position for RTL */
select.theme-input {
    cursor: pointer;
    padding-inline-end: 40px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E92A4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    font-size: 0.8125rem;
    font-weight: 600;
}

html.lang-fa select.theme-input {
    background-position: left 14px center;
    padding-inline-start: 40px;
    padding-inline-end: 16px;
}

select.theme-input option {
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    padding: 10px 14px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Text input with a leading/trailing inline icon or affix (e.g. @ for username) */
.input-affix-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-affix-group .theme-input {
    padding-inline-start: 34px;
}

.input-affix {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 1;
}

/* Count badge next to a textarea, e.g. character counter */
.field-counter {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    text-align: end;
}

/* Create Screen Feature Cards (Matches reference image 1.webp) */
.create-option-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-2xl);
    padding: 24px 22px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border-subtle);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.create-option-card:hover {
    transform: translateY(-2px);
}

.icon-ring-pink {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background-color: var(--color-brand-pink-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-core-pink {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background-color: var(--color-brand-pink);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-ring-blue {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background-color: var(--color-brand-softblue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-core-blue {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background-color: var(--color-brand-softblue);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-ring-purple {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background-color: var(--color-brand-purple-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-core-purple {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background-color: var(--color-brand-purple);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-card {
    width: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.96));
    border: 1px solid rgba(157, 141, 241, 0.18);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 22px -18px rgba(45, 49, 66, 0.25);
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.session-card:hover {
    transform: translateY(-1px);
    border-color: rgba(157, 141, 241, 0.4);
}

.session-card-current {
    background: linear-gradient(135deg, rgba(157, 141, 241, 0.12), rgba(157, 141, 241, 0.04));
    border-color: rgba(123, 104, 238, 0.34);
}

.session-card-selected {
    background: linear-gradient(135deg, rgba(157, 141, 241, 0.18), rgba(157, 141, 241, 0.1));
    border-color: var(--color-brand-purple-dark);
    box-shadow: 0 14px 28px -18px rgba(123, 104, 238, 0.7);
}

.session-card-top,
.session-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.session-card-top {
    margin-bottom: 8px;
}

.session-card-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.session-card-status {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(157, 141, 241, 0.08);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--color-brand-purple-dark);
    text-transform: uppercase;
}

.session-card-bottom {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.btn-pill-pink,
.btn-pill-blue {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-full);
    color: var(--color-text-primary);
    font-size: 0.8125rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-pill-pink {
    background-color: var(--color-brand-pink-btn);
}

.btn-pill-pink:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -6px rgba(244, 114, 182, 0.45);
}

html.dark .btn-pill-pink {
    background-color: rgba(244, 114, 182, 0.22);
    border: 1px solid rgba(244, 114, 182, 0.38);
    color: #FDF2F8;
}

html.dark .btn-pill-pink:hover {
    background-color: rgba(244, 114, 182, 0.32);
    border-color: rgba(244, 114, 182, 0.55);
    box-shadow: 0 8px 20px -4px rgba(244, 114, 182, 0.4);
}

.btn-pill-pink:active {
    transform: translateY(0);
}

.btn-pill-pink:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn-pill-blue {
    background-color: var(--color-brand-softblue-btn);
}

.btn-pill-blue:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -6px rgba(123, 156, 240, 0.45);
}

.btn-pill-blue:active {
    transform: translateY(0);
}

.btn-pill-blue:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring-blue);
}

.btn-pill-pink:disabled,
.btn-pill-blue:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary / ghost button, e.g. Cancel in modals */
.btn-ghost {
    width: 100%;
    padding: 13px 20px;
    border-radius: var(--radius-full);
    background-color: transparent;
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    font-weight: 700;
    border: 1.5px solid var(--color-border-default);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
}

.btn-ghost:hover {
    background-color: var(--color-surface-muted);
    color: var(--color-text-primary);
}

/* Sleek Resources Segmented Tab Switcher (Decks vs Notes) */
.resources-tab-bar {
    display: flex;
    gap: 6px;
    padding: 5px;
    background-color: var(--color-surface-segment, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl, 16px);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.resources-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    transition: all var(--transition-fast, 0.18s ease);
    user-select: none;
}

.resources-tab-btn:hover {
    color: var(--color-text-primary);
}

.resources-tab-btn.active {
    background-color: var(--color-surface-elevated, #ffffff);
    color: var(--color-brand-purple, #a855f7);
    font-weight: 700;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
}

.resources-tab-btn .tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9999px;
    background-color: var(--color-surface-muted, rgba(0, 0, 0, 0.06));
    color: var(--color-text-secondary);
    transition: all var(--transition-fast, 0.18s ease);
}

.resources-tab-btn.active .tab-badge {
    background-color: var(--color-brand-purple-light, rgba(168, 85, 247, 0.15));
    color: var(--color-brand-purple, #a855f7);
}

/* Hide tab bar in Focus Mode */
body.notes-focus-mode .resources-tab-bar {
    display: none !important;
}

/* Segmented Tab Switcher */
.segment-group {
    background-color: var(--color-surface-segment);
    border-radius: var(--radius-lg);
    padding: 4px;
    display: flex;
    gap: 4px;
}

.segment-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.segment-btn.active {
    background-color: var(--color-surface-elevated);
    color: var(--color-text-primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

/* Floating Bottom Navigation (Matches reference image 1.webp) */
.bottom-nav {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: min(100% - 20px, 408px);
    background-color: var(--color-nav-bg);
    border-radius: var(--radius-nav);
    padding: 9px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    box-shadow: var(--shadow-nav);
    z-index: 50;
    border: 1px solid var(--color-nav-border);
    transition: background-color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 10px;
    font-weight: 500;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 2px;
    text-decoration: none;
    transition: all var(--transition-fast);
    min-width: 0;
    flex: 1 1 0;
    max-width: 82px;
    white-space: nowrap;
}

.bottom-nav .nav-item:first-child {
    justify-self: auto;
}

.bottom-nav .nav-item:last-child {
    justify-self: auto;
}

.bottom-nav .fab {
    justify-self: center;
    flex: 0 0 auto;
    margin: 0 2px;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

.nav-item:hover,
.nav-item.active {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Floating Action Button (+) */
.fab {
    width: 52px;
    height: 52px;
    background-color: var(--color-fab-bg);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-fab);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    flex-shrink: 0;
}

.fab:hover {
    transform: translateY(-2px);
}

.fab.active {
    box-shadow: 0 0 0 3px var(--color-surface), var(--shadow-fab);
}

.fab svg {
    width: 24px;
    height: 24px;
    stroke: #FFFFFF;
    stroke-width: 2;
}

/* Toast Notification */
#toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--color-toast-bg);
    color: var(--color-toast-text);
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-toast);
    pointer-events: none;
    white-space: nowrap;
    max-width: calc(100% - 40px);
}

#toast.show {
    transform: translateX(-50%) translateY(0);
}

#toast svg {
    flex-shrink: 0;
}

/* ============================================================================
 * NOTES — redesigned markdown preview with header card & bullet list
 * ============================================================================ */
.note-pill {
    transition: all var(--transition-fast);
}

.notes-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.notes-card-header {
    padding: 18px 20px 16px;
    background: linear-gradient(135deg, var(--color-brand-blue-light), transparent);
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}

.notes-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-lg);
    background-color: var(--color-brand-blue-light);
    color: var(--color-brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notes-card-body {
    padding: 18px 20px 20px;
}

.markdown-preview h2 {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
    color: var(--color-text-primary);
}

.markdown-preview-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.markdown-preview-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.825rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.markdown-preview-list li::before {
    content: '';
    width: 7px;
    height: 7px;
    margin-top: 7px;
    border-radius: var(--radius-full);
    background-color: var(--color-brand-blue);
    flex-shrink: 0;
}

.markdown-preview-list li strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

/* ============================================================================
 * FLASHCARD & MULTILINGUAL MARKDOWN ENGINE — clean RTL/LTR + scrollable layout
 * ============================================================================ */
.flashcard {
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    min-height: 290px;
    display: flex;
    flex-direction: column;
}

.flashcard::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--color-brand-purple), var(--color-brand-pink));
    z-index: 1;
}

.flashcard-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 18px 20px 8px;
    flex-shrink: 0;
}

.flashcard-meta-chip {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    background-color: var(--color-surface-muted);
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.flashcard-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    text-align: start;
    padding: 12px 20px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 56vh;
    min-height: 196px;
    min-width: 0;
    overscroll-behavior-y: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-default) transparent;
}

.flashcard-stage {
    width: 100%;
    min-width: 0;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

.flashcard-deck-badge {
    align-self: center;
    max-width: 100%;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--color-brand-purple);
    background-color: var(--color-brand-purple-light);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    overflow-wrap: anywhere;
}

.flashcard-question {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.65;
    overflow-wrap: break-word;
}

.flashcard-answer-wrap {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.flashcard-divider {
    width: 100%;
    border-top: 1px dashed var(--color-border-default);
    margin: 2px 0;
}

.flashcard-answer {
    width: 100%;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 450;
    color: var(--color-text-primary);
    line-height: 1.78;
    animation: fadeIn 0.25s ease-out;
    overflow-wrap: break-word;
}

.flashcard-footer {
    padding: 6px 20px 18px;
    flex-shrink: 0;
}

/* Multilingual Direction & Typography Helpers */
.fc-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.fc-lang-fa,
.fc-dir-rtl {
    direction: rtl;
    text-align: right;
    font-family: var(--font-fa);
    letter-spacing: 0;
}

.fc-lang-en,
.fc-dir-ltr {
    direction: ltr;
    text-align: left;
    font-family: var(--font-en);
}

.fc-latin {
    font-family: var(--font-en);
    direction: ltr;
    unicode-bidi: isolate;
}

/* Rich Markdown Inside Flashcards, Modals & Previews */
.fc-md {
    font-size: 0.875rem;
    font-weight: 450;
    line-height: 1.78;
    color: var(--color-text-primary);
}

.flashcard-question.fc-md {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.7;
}

.flashcard-question.fc-md.fc-single-p p {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.65;
}

.fc-md.fc-compact {
    font-size: 0.8125rem;
    font-weight: 450;
    line-height: 1.65;
}

.fc-md.fc-compact.fc-single-p p {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.fc-md > :first-child {
    margin-top: 0;
}

.fc-md > :last-child {
    margin-bottom: 0;
}

.fc-md p,
.fc-md .fc-p {
    margin: 0 0 0.65em 0;
    overflow-wrap: anywhere;
}

.fc-md h1,
.fc-md h2,
.fc-md h3,
.fc-md h4,
.fc-md h5,
.fc-md h6 {
    font-weight: 800;
    line-height: 1.42;
    color: var(--color-text-primary);
    margin: 0.85em 0 0.42em 0;
    overflow-wrap: anywhere;
}

.fc-md > h1:first-child,
.fc-md > h2:first-child,
.fc-md > h3:first-child,
.fc-md > h4:first-child,
.fc-md > h5:first-child,
.fc-md > h6:first-child {
    margin-top: 0;
}

.fc-md h1 {
    font-size: 1.18em;
    padding-bottom: 0.28em;
    border-bottom: 1px solid var(--color-border-subtle);
}

.fc-md h2 {
    font-size: 1.08em;
    padding-bottom: 0.22em;
    border-bottom: 1px solid var(--color-border-subtle);
}

.fc-md h3 { font-size: 1em; color: var(--color-brand-purple-dark); }
.fc-md h4 { font-size: 0.94em; }
.fc-md h5,
.fc-md h6 { font-size: 0.88em; color: var(--color-text-secondary); }

html.dark .fc-md h3 {
    color: #C4B5FD;
}

.fc-md strong {
    font-weight: 800;
    color: var(--color-text-primary);
}

.fc-md em {
    font-style: italic;
}

.fc-md del {
    opacity: 0.72;
    text-decoration: line-through;
}

.fc-md ul,
.fc-md ol {
    margin: 0.45em 0 0.65em 0;
    padding-inline-start: 1.55em;
    padding-inline-end: 0;
    list-style-position: outside;
}

/* Higher-specificity override against global html[dir="rtl"] ul rule */
html[dir="rtl"] .fc-md ul,
.fc-md ul {
    list-style-type: disc;
    padding-inline-start: 1.55em;
}

.fc-md ul ul {
    list-style-type: circle;
    margin: 0.25em 0;
}

.fc-md ol {
    list-style-type: decimal;
}

.fc-md ul.fc-list-mixed,
.fc-md ol.fc-list-mixed {
    padding-inline: 1.55em;
}

.fc-md li {
    margin: 0.28em 0;
    overflow-wrap: anywhere;
}

.fc-md li > p {
    margin: 0.15em 0;
}

.fc-md ul.fc-task-list {
    list-style: none;
    padding-inline-start: 0.2em;
}

.fc-md .fc-task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
}

.fc-md .fc-task-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.28em;
    border-radius: 4px;
    border: 1.5px solid var(--color-border-default);
    background-color: var(--color-surface);
    font-size: 0.75em;
    font-weight: 800;
    flex-shrink: 0;
    color: transparent;
}

.fc-md .fc-task-box.checked {
    background-color: var(--color-brand-purple);
    border-color: var(--color-brand-purple);
    color: #FFFFFF;
}

.fc-md .fc-task-body {
    flex: 1;
    min-width: 0;
}

.fc-md .fc-blockquote {
    margin: 0.65em 0;
    padding: 8px 12px;
    border-inline-start: 3px solid var(--color-brand-purple);
    background-color: var(--color-brand-purple-light);
    border-start-start-radius: 4px;
    border-end-start-radius: 4px;
    border-start-end-radius: 10px;
    border-end-end-radius: 10px;
    color: var(--color-text-secondary);
}

.fc-md .fc-blockquote p:last-child {
    margin-bottom: 0;
}

.fc-md .fc-hr {
    border: 0;
    border-top: 1px dashed var(--color-border-default);
    margin: 0.85em 0;
}

.fc-md .fc-inline-code {
    font-family: var(--font-mono);
    font-size: 0.84em;
    padding: 0.1em 0.42em;
    border-radius: 6px;
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border-default);
    color: var(--color-brand-purple-dark);
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: break-spaces;
    vertical-align: baseline;
}

html.dark .fc-md .fc-inline-code {
    color: #C4B5FD;
    background-color: rgba(157, 141, 241, 0.14);
    border-color: rgba(157, 141, 241, 0.28);
}

.fc-md .fc-code-wrap {
    margin: 0.7em 0;
    border-radius: 14px;
    border: 1px solid var(--color-border-default);
    background-color: #1E293B;
    color: #E2E8F0;
    overflow: hidden;
    direction: ltr;
    text-align: left;
    max-width: 100%;
}

html.dark .fc-md .fc-code-wrap {
    background-color: #0F172A;
    border-color: #334155;
}

.fc-md .fc-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    background-color: rgba(15, 23, 42, 0.45);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94A3B8;
}

.fc-md .fc-code {
    margin: 0;
    padding: 11px 13px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    line-height: 1.62;
    color: #F1F5F9;
    white-space: pre;
    word-break: normal;
    direction: ltr;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.fc-md .fc-code code {
    font-family: inherit;
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.fc-md .fc-link {
    color: var(--color-brand-blue);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

html.dark .fc-md .fc-link {
    color: #93C5FD;
}

.fc-md .fc-table-wrap {
    margin: 0.65em 0;
    overflow-x: auto;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--color-border-default);
}

.fc-md .fc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78em;
}

.fc-md .fc-table th,
.fc-md .fc-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: top;
    overflow-wrap: break-word;
}

.fc-md .fc-table th {
    background-color: var(--color-surface-muted);
    font-weight: 700;
    color: var(--color-text-primary);
}

.fc-md .fc-table tr:last-child td {
    border-bottom: none;
}

.fc-md .fc-img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 0.45em 0;
    display: block;
}

.fc-card-preview {
    max-height: 156px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-default) transparent;
}

.btn-reveal {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-xl);
    background-color: var(--color-brand-purple-light);
    color: var(--color-brand-purple);
    font-weight: 700;
    font-size: 0.8125rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-reveal:hover {
    background-color: var(--color-brand-purple);
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* Rating buttons get slightly richer hover/press feedback */
.rating-btn {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.rating-btn:hover {
    transform: translateY(-2px);
}

.rating-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Empty state card, reused across pages (e.g. no decks / all caught up) */
.empty-state {
    background-color: var(--color-surface);
    border: 1.5px dashed var(--color-border-default);
    border-radius: var(--radius-2xl);
    padding: 36px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-full);
    background-color: var(--color-brand-purple-light);
    color: var(--color-brand-purple);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mascot Illustration container for empty states & milestone screens */
.mascot-illustration {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.mascot-illustration::before {
    content: '';
    position: absolute;
    width: 84px;
    height: 84px;
    border-radius: var(--radius-full);
    background: radial-gradient(circle, var(--color-brand-purple-light) 0%, transparent 72%);
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
}

html.dark .mascot-illustration::before {
    background: radial-gradient(circle, rgba(157, 141, 241, 0.22) 0%, transparent 72%);
}

.mascot-illustration img {
    position: relative;
    z-index: 1;
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 6px 14px rgba(45, 49, 66, 0.08));
    animation: mascotSubtleFloat 3s ease-in-out infinite alternate;
}

html.dark .mascot-illustration img {
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}

@keyframes mascotSubtleFloat {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mascot-illustration img {
        animation: none;
    }
}

.mascot-intro-backdrop {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: var(--radius-full);
    background: radial-gradient(circle, var(--color-brand-pink-light) 0%, rgba(238, 240, 255, 0.5) 50%, transparent 75%);
    opacity: 0.85;
    z-index: 0;
    pointer-events: none;
}

html.dark .mascot-intro-backdrop {
    background: radial-gradient(circle, rgba(244, 114, 182, 0.18) 0%, rgba(157, 141, 241, 0.12) 50%, transparent 75%);
}

/* Tour Mascot display inside product tour tooltip */
.tour-mascot-box {
    position: relative;
    width: 76px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tour-mascot-glow {
    position: absolute;
    inset: 2px;
    border-radius: var(--radius-full);
    background: radial-gradient(circle, var(--color-brand-purple-light) 0%, transparent 75%);
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
}

html.dark .tour-mascot-glow {
    background: radial-gradient(circle, rgba(157, 141, 241, 0.25) 0%, transparent 75%);
}

.tour-mascot-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 6px 12px rgba(45, 49, 66, 0.12));
    animation: mascotSubtleFloat 3s ease-in-out infinite alternate;
}

html.dark .tour-mascot-img {
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}

.empty-state-title {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--color-text-primary);
}

.empty-state-body {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 280px;
}

/* ============================================================================
 * LANGUAGE SWITCH — small pill toggle in the header
 * ============================================================================ */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* ============================================================================
 * MODAL / SHEET — used by the feedback form
 * ============================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 30, 0.45);
    backdrop-filter: blur(2px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-sheet {
    width: 100%;
    max-width: var(--app-max-width);
    background-color: var(--color-surface);
    border-radius: 28px 28px 0 0;
    padding: 22px 22px calc(22px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(24px);
    transition: transform var(--transition-base);
    max-height: 88vh;
    overflow-y: auto;
}

.modal-overlay.show .modal-sheet {
    transform: translateY(0);
}

@media (min-width: 540px) {
    .modal-overlay {
        align-items: center;
    }
    .modal-sheet {
        border-radius: var(--radius-2xl);
        transform: translateY(12px) scale(0.98);
    }
}

.modal-handle {
    width: 40px;
    height: 4px;
    border-radius: var(--radius-full);
    background-color: var(--color-border-default);
    margin: 0 auto 16px;
}

button, a, input, select, textarea, [role="button"] {
    touch-action: manipulation;
}

button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
    outline: 2px solid var(--color-brand-purple);
    outline-offset: 2px;
}

.modal-close-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background-color: var(--color-surface-muted);
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    background-color: var(--color-border-default);
    color: var(--color-text-primary);
}

/* Feedback type chooser (radio-style pills) */
.option-pill-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.option-pill {
    flex: 1;
    min-width: 88px;
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    background-color: var(--color-surface-muted);
    border: 1.5px solid transparent;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.option-pill.active {
    background-color: var(--color-brand-purple-light);
    border-color: var(--color-brand-purple);
    color: var(--color-brand-purple);
}

/* ============================================================================
 * PROFILE PAGE
 * ============================================================================ */
.profile-header-card {
    background: linear-gradient(135deg, var(--color-brand-pink-light), var(--color-brand-purple-light));
    border-radius: var(--radius-2xl);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    border: 1px solid var(--color-border-subtle);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background-color: var(--color-surface);
    color: var(--color-brand-pink-dark);
    font-size: 1.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
    border: 3px solid var(--color-surface);
}

.profile-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.profile-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.profile-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text-primary);
}

.profile-stat-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 4px;
}

.settings-row + .settings-row {
    border-top: 1px solid var(--color-border-subtle);
}

.settings-row-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.settings-row-desc {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-top: 1px;
}

/* Segmented language control used in profile settings */
.lang-seg {
    display: inline-flex;
    background-color: var(--color-surface-muted);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 2px;
}

.lang-seg-btn {
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-seg-btn.active {
    background-color: var(--color-surface);
    color: var(--color-brand-pink-dark);
    box-shadow: var(--shadow-sm);
}

/* Feedback floating button (placed in header area) */
.btn-feedback-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 15px 18px;
    border-radius: var(--radius-xl);
    background-color: var(--color-surface);
    border: 1.5px solid var(--color-border-subtle);
    color: var(--color-text-primary);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-feedback-row:hover {
    border-color: var(--color-brand-purple);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.btn-feedback-row .icon-chevron {
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

html.lang-fa .btn-feedback-row .icon-chevron {
    transform: scaleX(-1);
}

html.lang-fa .back-chevron {
    transform: scaleX(-1);
}

/* ============================================================================
 * RTL ADJUSTMENTS
 * ============================================================================ */
html[dir="rtl"] .markdown-preview-list,
html[dir="rtl"] ul {
    padding-right: 0;
}

html[dir="rtl"] .bottom-nav {
    direction: rtl;
}

/* Keep numeric/progress bars visually left-to-right in RTL for legibility is not needed;
   bars are purely decorative width-based so no change required. */

/* Hide Scrollbar Utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================================================
 * AUTH, READ-ONLY INPUTS & RESPONSIVE ADMIN SHELL
 * ============================================================================ */
.theme-input[readonly],
.theme-input:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    background-color: var(--color-surface-muted);
    border-color: var(--color-border-subtle);
}

.auth-shell {
    width: 100%;
    max-width: var(--app-max-width);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    background-color: var(--color-app-bg);
    box-shadow: var(--shadow-app);
    padding: 28px 22px 32px 22px;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-base), color var(--transition-base);
}

.auth-shell > .page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    margin-top: auto;
    margin-bottom: auto;
}

.admin-wrapper {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    background-color: var(--color-app-bg);
    box-shadow: none;
    padding: 16px 14px 48px 14px;
    transition: background-color var(--transition-base), color var(--transition-base);
}

.admin-wrapper > #app-header,
.admin-wrapper > .page-content {
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 640px) {
    .admin-wrapper {
        padding: 24px 28px 56px 28px;
    }
}

@media (min-width: 1024px) {
    .admin-wrapper {
        padding: 28px 40px 64px 40px;
    }
}

@media (min-width: 1440px) {
    .admin-wrapper {
        padding: 32px 56px 72px 56px;
    }
}

.admin-wrapper .modal-sheet-lg {
    max-width: min(94vw, 920px) !important;
}

.alert-banner {
    border-radius: var(--radius-xl);
    padding: 12px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    display: none;
    align-items: flex-start;
    gap: 8px;
}

.alert-banner.show {
    display: flex;
}

.alert-banner-error {
    background-color: var(--color-brand-pink-light);
    color: var(--color-brand-pink-dark);
    border: 1px solid rgba(219, 39, 119, 0.2);
}

.alert-banner-success {
    background-color: var(--color-brand-green-light);
    color: var(--color-brand-green);
    border: 1px solid rgba(60, 208, 154, 0.25);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border-subtle);
}

.admin-table td {
    padding: 13px 14px;
    font-size: 0.8125rem;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background-color: var(--color-surface-muted);
}

/* ============================================================================
 * MINIMAL NOTES & READING EXPERIENCE (Obsidian-Inspired)
 * Navigation Flow: Notes (Folders List) → Folder (Notes List) → Note (Reader)
 * ============================================================================ */
.notes-app-wrapper {
    width: 100%;
    max-width: 840px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: var(--color-app-bg);
    box-shadow: var(--shadow-app);
    position: relative;
    padding: 24px 20px 120px 20px;
    transition: background-color var(--transition-base), color var(--transition-base);
}

@media (max-width: 640px) {
    .notes-app-wrapper {
        padding: 18px 14px 120px 14px;
    }
}

/* Breadcrumb Navigation */
.notes-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.notes-breadcrumb a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.notes-breadcrumb a:hover {
    color: var(--color-brand-purple-dark);
}

.notes-breadcrumb .crumb-sep {
    color: var(--color-text-muted);
    opacity: 0.6;
}

/* Back Navigation Button */
.notes-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.notes-back-btn:hover {
    color: var(--color-text-primary);
    border-color: var(--color-brand-purple);
    transform: translateX(-2px);
}

html[dir="rtl"] .notes-back-btn:hover {
    transform: translateX(2px);
}

/* Folder Card */
.folder-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-2xl);
    padding: 18px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

.folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.08);
    border-color: rgba(157, 141, 241, 0.35);
}

.folder-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-xl);
    background-color: rgba(157, 141, 241, 0.12);
    color: var(--color-brand-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Note Card in Folder View */
.note-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
    padding: 16px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.note-card:hover {
    border-color: var(--color-brand-purple);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.07);
}

/* Reading Paper / Distraction-Free Layout */
.notes-reading-paper {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-2xl);
    padding: 32px 36px;
    box-shadow: var(--shadow-card);
    margin-top: 14px;
}

@media (max-width: 640px) {
    .notes-reading-paper {
        padding: 22px 18px;
    }
}

.notes-reading-content {
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--color-text-primary);
}

/* Focus / Do Not Disturb Mode */
body.notes-focus-mode {
    background-color: var(--color-surface) !important;
}

body.notes-focus-mode #app-header,
body.notes-focus-mode #app-bottom-nav,
body.notes-focus-mode .notes-top-bar,
body.notes-focus-mode .notes-nav-breadcrumbs,
body.notes-focus-mode .notes-actions-strip {
    display: none !important;
}

body.notes-focus-mode .notes-app-wrapper {
    max-width: 800px;
    padding: 48px 20px 80px 20px;
    box-shadow: none;
    background: transparent;
}

body.notes-focus-mode .notes-reading-paper {
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

/* Floating Exit Focus Mode Pill */
.focus-exit-pill {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 200;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--color-toast-bg);
    color: var(--color-toast-text);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-toast);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: all var(--transition-fast);
}

html[dir="rtl"] .focus-exit-pill {
    right: auto;
    left: 24px;
}

.focus-exit-pill:hover {
    transform: scale(1.04);
}

.focus-exit-pill kbd {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: var(--font-mono);
}

/* Large Modal Sheet for Note Editing */
.modal-sheet-lg {
    max-width: min(92vw, 680px) !important;
}

/* Obsidian Callouts (Styled like desktop Obsidian) */
.obsidian-callout {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-brand-blue);
    background-color: rgba(74, 98, 255, 0.06);
    color: var(--color-text-primary);
}

html[dir="rtl"] .obsidian-callout {
    border-left: none;
    border-right: 4px solid var(--color-brand-blue);
}

.obsidian-callout-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.8125rem;
    margin-bottom: 6px;
}

.obsidian-callout-icon svg {
    display: block;
}

.obsidian-callout-body {
    font-size: 0.88rem;
    line-height: 1.65;
}

.obsidian-callout-note {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.08);
}
.obsidian-callout-note .obsidian-callout-header {
    color: #2563eb;
}

.obsidian-callout-tip {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.08);
}
.obsidian-callout-tip .obsidian-callout-header {
    color: #059669;
}

.obsidian-callout-warning {
    border-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.08);
}
.obsidian-callout-warning .obsidian-callout-header {
    color: #d97706;
}

.obsidian-callout-important {
    border-color: #8b5cf6;
    background-color: rgba(139, 92, 246, 0.08);
}
.obsidian-callout-important .obsidian-callout-header {
    color: #7c3aed;
}

.obsidian-callout-danger,
.obsidian-callout-caution {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.08);
}
.obsidian-callout-danger .obsidian-callout-header,
.obsidian-callout-caution .obsidian-callout-header {
    color: #dc2626;
}

.obsidian-callout-question {
    border-color: #06b6d4;
    background-color: rgba(6, 182, 212, 0.08);
}
.obsidian-callout-question .obsidian-callout-header {
    color: #0891b2;
}

.obsidian-callout-todo,
.obsidian-callout-success {
    border-color: #6366f1;
    background-color: rgba(99, 102, 241, 0.08);
}
.obsidian-callout-todo .obsidian-callout-header,
.obsidian-callout-success .obsidian-callout-header {
    color: #4f46e5;
}

/* Obsidian Wiki-Link */
.obsidian-wikilink {
    color: var(--color-brand-purple-dark);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
    padding: 1px 4px;
    border-radius: 4px;
    background-color: rgba(157, 141, 241, 0.1);
    transition: all var(--transition-fast);
}

.obsidian-wikilink:hover {
    background-color: rgba(157, 141, 241, 0.22);
    text-decoration-style: solid;
}

/* Obsidian Tag */
.obsidian-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    background-color: rgba(157, 141, 241, 0.15);
    color: var(--color-brand-purple-dark);
    margin: 0 2px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.obsidian-tag:hover {
    background-color: var(--color-brand-purple);
    color: #ffffff;
}

/* Code Copy Button */
.fc-code-copy-btn {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.15s ease;
}

.fc-code-copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.fc-code-copy-btn.copied {
    background-color: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

/* Checkboxes in Reader Mode */
.fc-task-box[data-task-toggle="true"] {
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.fc-task-box[data-task-toggle="true"]:hover {
    transform: scale(1.15);
}

/* Obsidian Wiki-Link */
.obsidian-wikilink {
    color: var(--color-brand-purple-dark);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
    padding: 1px 4px;
    border-radius: 4px;
    background-color: rgba(157, 141, 241, 0.1);
    transition: all var(--transition-fast);
}

.obsidian-wikilink:hover {
    background-color: rgba(157, 141, 241, 0.22);
    text-decoration-style: solid;
}

/* Obsidian Tag */
.obsidian-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    background-color: rgba(157, 141, 241, 0.15);
    color: var(--color-brand-purple-dark);
    margin: 0 2px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.obsidian-tag:hover {
    background-color: var(--color-brand-purple);
    color: #ffffff;
}

/* Code Copy Button */
.fc-code-copy-btn {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.15s ease;
}

.fc-code-copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.fc-code-copy-btn.copied {
    background-color: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

/* Checkboxes in Reader Mode */
.fc-task-box[data-task-toggle="true"] {
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.fc-task-box[data-task-toggle="true"]:hover {
    transform: scale(1.15);
}

/* ============================================================================
 * ONBOARDING EXPERIENCE & PRODUCT TOUR
 * ============================================================================ */
.onboarding-fullscreen-container {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: var(--color-app-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.onboarding-mobile-shell {
    width: 100%;
    max-width: var(--app-max-width, 480px);
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 22px 28px 22px;
    position: relative;
    background-color: var(--color-app-bg);
}

.onboarding-slide-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 0;
    animation: onboardingFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-slide-svg {
    width: 100%;
    max-width: 280px;
    height: 190px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.onboarding-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.onboarding-modal-card {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-default);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 30rem;
    overflow: hidden;
    transform: scale(0.95) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.onboarding-active {
    opacity: 1 !important;
}

.onboarding-active .onboarding-modal-card {
    transform: scale(1) translateY(0) !important;
}

/* ============================================================================
 * SHELF TOGGLE SWITCH (iOS / Modern Pill style)
 * ============================================================================ */
.shelf-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.shelf-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

.shelf-switch-track {
    width: 38px;
    height: 22px;
    background-color: var(--color-border-default, #E5E7EB);
    border-radius: 9999px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.shelf-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.shelf-switch input:checked + .shelf-switch-track {
    background-color: var(--color-brand-purple, #9D8DF1);
}

/* ============================================================================
 * DAILY STREAK WIDGETS (Header Pill, Home Banner, 7-Day Progress)
 * ============================================================================ */
.streak-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #FFF7E0 0%, #FFE4EC 100%);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #B45309;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.14);
}

.streak-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.22);
}

.streak-pill:active {
    transform: scale(0.96);
}

.streak-pill-flame {
    color: #F59E0B;
    display: inline-flex;
    align-items: center;
    filter: drop-shadow(0 1px 3px rgba(245, 158, 11, 0.35));
}

html.dark .streak-pill {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(244, 114, 182, 0.16) 100%);
    border-color: rgba(251, 191, 36, 0.32);
    color: #FCD34D;
}

html.dark .streak-pill-flame {
    color: #FBBF24;
}

@keyframes streakPop {
    0% { transform: scale(1); }
    35% { transform: scale(1.16); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.streak-pill-pop {
    animation: streakPop 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.streak-banner-card {
    width: 100%;
    text-align: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #FFFBF0 0%, #FFF4F8 58%, #F6F5FF 100%);
    border: 1px solid rgba(245, 158, 11, 0.24);
    box-shadow: 0 8px 24px -10px rgba(245, 158, 11, 0.22);
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.streak-banner-card:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 12px 26px -10px rgba(245, 158, 11, 0.3);
}

html.dark .streak-banner-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(244, 114, 182, 0.1) 58%, rgba(157, 141, 241, 0.12) 100%);
    border-color: rgba(251, 191, 36, 0.25);
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.45);
}

.streak-flame-badge {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #FDE68A 0%, #FDBA74 100%);
    color: #B45309;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.streak-flame-badge svg {
    width: 20px;
    height: 20px;
}

html.dark .streak-flame-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(249, 115, 22, 0.24) 100%);
    color: #FCD34D;
}

.streak-week-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.streak-day-dot {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    background-color: var(--color-surface-muted);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-subtle);
    transition: transform var(--transition-fast);
}

.streak-day-dot.done {
    background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.28);
}

.streak-day-dot.today {
    background: linear-gradient(135deg, #F59E0B 0%, #EC4899 100%);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* Full-screen Streak Celebration Overlay (on deck catch-up) */
.streak-celebrate-overlay {
    position: fixed;
    inset: 0;
    z-index: 99995;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 50% 35%, rgba(254, 243, 199, 0.94) 0%, rgba(252, 231, 243, 0.94) 48%, rgba(238, 240, 255, 0.96) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    transition: opacity 0.35s ease;
    overflow: hidden;
}

html.dark .streak-celebrate-overlay {
    background: radial-gradient(circle at 50% 35%, rgba(45, 27, 14, 0.95) 0%, rgba(36, 17, 46, 0.96) 52%, rgba(9, 9, 11, 0.98) 100%);
}

.streak-celebrate-overlay.show {
    opacity: 1;
}

.streak-confetti-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.streak-confetti-piece {
    position: absolute;
    top: -16px;
    width: 10px;
    height: 16px;
    border-radius: 4px;
    opacity: 0;
    animation: streakConfettiFall var(--dur, 2.8s) cubic-bezier(0.2, 0.7, 0.3, 1) var(--delay, 0s) forwards;
}

@keyframes streakConfettiFall {
    0% {
        opacity: 0;
        transform: translateY(-20px) rotate(0deg) scale(0.7);
    }
    12% {
        opacity: 0.95;
    }
    85% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translateY(105vh) rotate(var(--rot, 520deg)) scale(1);
    }
}

.streak-celebrate-stage {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 390px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 2rem;
    padding: 28px 24px 24px;
    text-align: center;
    box-shadow: 0 28px 70px -16px rgba(245, 158, 11, 0.32), 0 12px 32px -12px rgba(157, 141, 241, 0.25);
    transform: translateY(24px) scale(0.9);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .streak-celebrate-stage {
    background: rgba(24, 24, 27, 0.92);
    border-color: rgba(251, 191, 36, 0.24);
    box-shadow: 0 28px 70px -16px rgba(0, 0, 0, 0.75);
}

.streak-celebrate-overlay.show .streak-celebrate-stage {
    transform: translateY(0) scale(1);
}

.streak-celebrate-aura {
    position: relative;
    width: 112px;
    height: 112px;
    margin: 4px auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.streak-celebrate-ring {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, rgba(244, 114, 182, 0.16) 55%, transparent 75%);
    animation: streakAuraPulse 2s ease-in-out infinite;
}

@keyframes streakAuraPulse {
    0%, 100% { transform: scale(0.95); opacity: 0.75; }
    50% { transform: scale(1.16); opacity: 1; }
}

.streak-celebrate-flame-orb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #FDE047 0%, #F59E0B 52%, #EC4899 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 32px rgba(245, 158, 11, 0.42);
    animation: streakOrbIn 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.streak-celebrate-flame-orb svg {
    width: 36px;
    height: 36px;
}

@keyframes streakOrbIn {
    0% { transform: scale(0.4) rotate(-14deg); }
    65% { transform: scale(1.14) rotate(4deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.streak-celebrate-number {
    font-size: 3.1rem;
    line-height: 1.05;
    font-weight: 900;
    background: linear-gradient(135deg, #D97706 0%, #DB2777 60%, #7B68EE 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

html.dark .streak-celebrate-number {
    background: linear-gradient(135deg, #FDE047 0%, #F472B6 65%, #A78BFA 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.streak-celebrate-number.bump {
    animation: streakNumberBump 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes streakNumberBump {
    0% { transform: scale(0.8); opacity: 0.5; }
    55% { transform: scale(1.22); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.shelf-switch input:checked + .shelf-switch-track .shelf-switch-thumb {
    transform: translateX(16px);
}

.shelf-switch input:focus-visible + .shelf-switch-track {
    box-shadow: 0 0 0 2px var(--color-app-bg), 0 0 0 4px var(--color-brand-purple, #9D8DF1);
}

/* ============================================================================
 * FULL-WIDTH DESKTOP LANDING PAGE (.landing-shell)
 * ============================================================================ */
.landing-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    background-color: var(--color-app-bg);
    color: var(--color-text-primary);
    position: relative;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

.landing-ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.landing-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(85px);
    opacity: 0.7;
    transition: background-color var(--transition-base), opacity var(--transition-base);
    animation: landingDrift 16s ease-in-out infinite alternate;
}

html.dark .landing-blob {
    opacity: 0.35;
}

.landing-blob-pink {
    width: 540px;
    height: 540px;
    top: -160px;
    right: -120px;
    background: var(--color-brand-pink-light);
}

.landing-blob-purple {
    width: 580px;
    height: 580px;
    top: 120px;
    left: -180px;
    background: var(--color-brand-purple-light);
    animation-delay: -5s;
}

.landing-blob-blue {
    width: 500px;
    height: 500px;
    bottom: -140px;
    right: 15%;
    background: var(--color-brand-softblue-light);
    animation-delay: -10s;
}

@keyframes landingDrift {
    0% { transform: translate(0px, 0px) scale(1); }
    50% { transform: translate(28px, -22px) scale(1.06); }
    100% { transform: translate(-20px, 24px) scale(0.96); }
}

.landing-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-color: color-mix(in srgb, var(--color-app-bg) 80%, transparent);
    border-bottom: 1px solid var(--color-border-subtle);
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

.landing-cta-primary {
    background: linear-gradient(135deg, var(--color-brand-purple) 0%, var(--color-brand-pink) 100%);
    color: #FFFFFF;
    box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--color-brand-purple) 55%, transparent);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, opacity 0.2s ease;
}

.landing-cta-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.28) 50%, transparent 75%);
    transform: translateX(-120%);
    transition: transform 0.65s ease;
}

.landing-cta-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 18px 36px -10px color-mix(in srgb, var(--color-brand-pink) 55%, transparent);
}

.landing-cta-primary:hover::after {
    transform: translateX(120%);
}

.landing-cta-primary:active {
    transform: scale(0.97);
}

.landing-bento-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 2rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.25s ease, background-color var(--transition-base);
}

.landing-bento-card:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--color-brand-purple) 40%, var(--color-border-subtle));
    box-shadow: 0 26px 52px -16px rgba(45, 49, 66, 0.14);
}

.landing-bento-card .landing-mascot-img {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.landing-bento-card:hover .landing-mascot-img {
    transform: translateY(-4px) rotate(-4deg) scale(1.06);
}

html.dark .landing-bento-card:hover {
    box-shadow: 0 26px 52px -16px rgba(0, 0, 0, 0.6);
}

/* 3D Interactive Flashcard Showcase */
.landing-flip-scene {
    perspective: 1200px;
}

.landing-flip-card {
    position: relative;
    width: 100%;
    min-height: 295px;
    transform-style: preserve-3d;
    transition: transform 0.72s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.landing-flip-card.is-flipped {
    transform: rotateY(180deg);
}

.landing-flip-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 2rem;
    box-shadow: 0 28px 64px -18px rgba(45, 49, 66, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

html.dark .landing-flip-face {
    box-shadow: 0 28px 64px -18px rgba(0, 0, 0, 0.68);
}

.landing-flip-back {
    transform: rotateY(180deg);
}

/* Scroll Reveal Animations */
.landing-reveal {
    opacity: 0;
    transform: translateY(26px) scale(0.98);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Animated SVG Retention Curve */
.landing-curve-path {
    stroke-dasharray: 360;
    stroke-dashoffset: 360;
    transition: stroke-dashoffset 1.3s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

.is-visible .landing-curve-path {
    stroke-dashoffset: 0;
}

/* Animated Mastery Ring */
.landing-ring-progress {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.is-visible .landing-ring-progress {
    stroke-dashoffset: 28;
}

@keyframes landingFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-9px); }
}

@keyframes landingSparkle {
    0%, 100% { transform: scale(0.85) rotate(0deg); opacity: 0.55; }
    50% { transform: scale(1.18) rotate(15deg); opacity: 1; }
}

.landing-float {
    animation: landingFloat 4.2s ease-in-out infinite;
}

.landing-float-delayed {
    animation: landingFloat 5s ease-in-out 0.7s infinite;
}

.landing-sparkle {
    animation: landingSparkle 2.8s ease-in-out infinite;
}

.landing-sparkle-delayed {
    animation: landingSparkle 3.2s ease-in-out 1.1s infinite;
}

/* Social UI & Sexy Micro-Interactions */
.landing-social-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 1.75rem;
    box-shadow: var(--shadow-card);
    position: relative;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.25s ease;
}

.landing-social-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, var(--color-brand-pink), var(--color-brand-purple), var(--color-brand-softblue));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.landing-social-card:hover {
    transform: translateY(-7px) scale(1.015);
    box-shadow: 0 28px 56px -16px color-mix(in srgb, var(--color-brand-purple) 26%, transparent);
}

.landing-social-card:hover::before {
    opacity: 0.85;
}

.landing-avatar-ring {
    padding: 2px;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--color-brand-pink), var(--color-brand-purple), var(--color-brand-softblue));
}

@keyframes heartPop {
    0% { transform: scale(1); }
    35% { transform: scale(1.42); }
    65% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.landing-heart-btn.is-liked svg {
    fill: var(--color-brand-pink);
    color: var(--color-brand-pink);
    animation: heartPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes livePing {
    0% { transform: scale(0.9); opacity: 0.85; }
    75%, 100% { transform: scale(2.2); opacity: 0; }
}

.landing-live-ping {
    animation: livePing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes landingMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.landing-marquee-wrap {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.landing-marquee-track {
    display: flex;
    width: max-content;
    gap: 0.75rem;
    animation: landingMarquee 28s linear infinite;
}

.landing-marquee-wrap:hover .landing-marquee-track {
    animation-play-state: paused;
}

html[dir="rtl"] .landing-marquee-track {
    animation-direction: reverse;
}

.landing-svg-node {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.landing-bento-card:hover .landing-svg-node {
    transform: scale(1.08);
}

/* ============================================================================
 * AI TERMINAL AGENT MOCKUP & SKILL GUIDE STYLES
 * ============================================================================ */
.landing-terminal-wrap {
    position: relative;
    max-width: 100%;
    min-width: 0;
    border-radius: 1.75rem;
    padding: 1.5px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--color-brand-purple) 55%, transparent),
        color-mix(in srgb, var(--color-brand-pink) 50%, transparent),
        color-mix(in srgb, var(--color-brand-softblue) 55%, transparent));
    box-shadow: 0 28px 60px -18px rgba(45, 49, 66, 0.28);
}

html.dark .landing-terminal-wrap {
    box-shadow: 0 28px 60px -18px rgba(0, 0, 0, 0.72);
}

.landing-terminal {
    background: #141622;
    color: #E5E7EB;
    border-radius: calc(1.75rem - 1.5px);
    overflow: hidden;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.landing-terminal-header {
    background: #1C1F30;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.landing-terminal-dot {
    width: 11px;
    height: 11px;
    border-radius: 9999px;
    display: inline-block;
}

.landing-terminal-tab {
    padding: 0.35rem 0.75rem;
    border-radius: 0.65rem;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    color: #9CA3AF;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.landing-terminal-tab:hover {
    color: #F3F4F6;
    background: rgba(255, 255, 255, 0.06);
}

.landing-terminal-tab.is-active {
    color: #FFFFFF;
    background: rgba(167, 139, 250, 0.2);
    border-color: rgba(167, 139, 250, 0.45);
}

@keyframes terminalCursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.landing-terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: #A78BFA;
    vertical-align: text-bottom;
    margin-inline-start: 4px;
    border-radius: 2px;
    animation: terminalCursorBlink 1.1s infinite;
}

.skill-step-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 1.75rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, box-shadow 0.3s ease;
}

.skill-step-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--color-brand-purple) 45%, var(--color-border-subtle));
    box-shadow: 0 22px 44px -16px color-mix(in srgb, var(--color-brand-purple) 22%, transparent);
}


