/* =====================
   BOTTOM SHEETS
   ===================== */
.bottom-sheet {
    position: absolute;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}

.bottom-sheet:not(.hidden) {
    pointer-events: auto;
}

.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    animation: bdIn 0.2s ease;
}

@keyframes bdIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sheet-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 14px 22px 36px;
    max-height: 85vh;
    overflow-y: auto;
    animation: sheetUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes sheetUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.sheet-drag-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    margin: 0 auto 18px;
}

/* Sheet nav tabs */
.sheet-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.sheet-tab {
    position: relative;
    flex: 1;
    padding: 8px 6px;
    border-radius: var(--r-pill);
    border: 1.5px solid var(--border-light);
    background: white;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t);
}

.sheet-tab.active {
    background: #f6edff;
    border-color: #e4c7ff;
    font-weight: 600;
}

.premium-tab-label .premium-star-badge {
    right: 4px;
    bottom: 4px;
    width: 13px;
    height: 13px;
    font-size: 0.66rem;
    -webkit-text-stroke: 0;
}

/* Panes */
.tab-pane {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.note-type-row {
    display: flex;
    gap: 10px;
}

.note-type-btn {
    position: relative;
    flex: 1;
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-card);
    background: white;
    padding: 10px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--t);
}

.note-type-btn .premium-star-badge {
    right: 5px;
    bottom: 5px;
    width: 13px;
    height: 13px;
    font-size: 0.66rem;
    -webkit-text-stroke: 0;
}

.note-type-btn.active {
    border-color: #c084fc;
    background: #faf5ff;
    color: var(--text-primary);
}

.nt-preview {
    border-radius: 3px;
}

.plain-preview-mini {
    width: 34px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-family: var(--font-hand), monospace;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.tape-preview-mini {
    width: 50px;
    height: 12px;
    background: var(--tape);
    background-image: repeating-linear-gradient(90deg, transparent 0, transparent 4px,
            rgba(160, 140, 100, 0.1) 4px, rgba(160, 140, 100, 0.1) 5px);
}

.sticky-preview-mini {
    width: 22px;
    height: 22px;
    background: var(--sticky-yellow);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.sticky-color-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform var(--t), border-color var(--t);
}

.color-swatch.active {
    border-color: #7c3aed;
    transform: scale(1.15);
}

.note-textarea {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    resize: none;
    outline: none;
    border: none;
    font-family: var(--font-hand);
    font-size: 1rem;
    line-height: 1.4;
    transition: color var(--t);
    background: transparent;
    overflow: hidden;
}

.note-textarea:focus {
    outline: none;
    border: none;
}

.note-preview-card {
    position: relative;
    z-index: 1;
    transition: all var(--t);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Plain text preview card */
.note-preview-card.preview-plain {
    width: 180px;
    min-height: 110px;
    background: transparent;
    transform: none;
}

.note-preview-card.preview-plain .note-textarea {
    min-height: 110px;
    padding: 12px 10px;
    color: #000;
    font-family: var(--font-hand), monospace;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

/* Tape preview card */
.note-preview-card.preview-tape {
    width: 180px;
    height: 90px;
    background-image: url('../Component/masking tape.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    transform: rotate(-2deg);
}

.note-preview-card.preview-tape .note-textarea {
    padding: 21px 26px;
    font-size: 0.95rem;
    line-height: 1.2;
}

/* Sticky preview card */
.note-preview-card.preview-sticky {
    width: 140px;
    height: 140px;
    transform: rotate(-1.5deg);
}

.note-preview-card.preview-sticky::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('../Component/sticky note.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: -1;
    transition: filter var(--t);
}

.note-preview-card.preview-sticky.yellow::before {
    filter: none;
}

.note-preview-card.preview-sticky.pink::before {
    filter: hue-rotate(-65deg) saturate(1.4) brightness(1.05);
}

.note-preview-card.preview-sticky.blue::before {
    filter: hue-rotate(145deg) saturate(1.4) brightness(1.05);
}

.note-preview-card.preview-sticky .note-textarea {
    padding: 18px 15px;
    font-size: 1rem;
}

.editor-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -4px;
    padding: 0 4px;
}

.alignment-row {
    display: flex;
    gap: 4px;
    background: var(--bg-soft);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.align-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t);
}

.align-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

.align-btn.active {
    color: #7c3aed;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.char-counter {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.item-note-text {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    display: inline-block;
    text-align: inherit;
    overflow: hidden;
}

.pane-hint {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.question-pane-hint {
    margin: 0 0 -2px;
}

.question-input-wrap {
    position: relative;
    width: 100%;
}

#question-input {
    width: 100%;
    min-height: 104px;
    margin: 0;
    padding: 12px 14px 28px;
    box-sizing: border-box;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    font-family: var(--font-ui);
    resize: none;
    outline: none;
}

#question-input:focus {
    border-color: #c084fc;
}

.question-char-counter {
    position: absolute;
    right: 12px;
    bottom: 9px;
    color: #888888;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    line-height: 1;
    pointer-events: none;
}

.sheet-input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--r-card);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--t);
}

.sheet-input:focus {
    border-color: #c084fc;
}

.sheet-input.input-attention {
    animation: inputAttention 0.75s ease;
}

@keyframes inputAttention {
    0%, 100% {
        border-color: var(--border-light);
        box-shadow: none;
    }
    35%, 70% {
        border-color: #a855f7;
        box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16);
    }
}

.song-preview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--r-card);
    border: 1.5px solid var(--border-light);
    background: #fafafa;
}

.song-cd-sm {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #ff9de2, #c77dff, #4895ef, #ff9de2);
    position: relative;
    flex-shrink: 0;
}

.song-cd-sm::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: #eee;
    transform: translate(-50%, -50%);
}

.song-preview-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.song-preview-artist {
    font-size: 0.8rem;
    color: var(--text-muted);
}



.btn-submit-sheet {
    width: 100%;
    padding: 14px;
    border-radius: var(--r-pill);
    background: var(--text-primary);
    color: white;
    border: none;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--t), box-shadow var(--t);
}

.btn-submit-sheet:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-submit-sheet:active {
    transform: scale(0.98);
}

/* =====================
   INBOX DETAIL
   ===================== */
.inbox-detail-content {
    padding: 8px 0 20px;
    min-height: 140px;
}

.inbox-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.btn-publish-action,
.btn-reply-action,
.btn-delete-action {
    width: 100%;
    padding: 13px;
    border-radius: var(--r-pill);
    border: none;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--t);
}

.btn-publish-action {
    background: var(--text-primary);
    color: white;
}

.btn-reply-action {
    background: var(--nav-active);
    color: var(--text-primary);
}

.btn-delete-action {
    background: white;
    color: #e8453c;
    border: 1.5px solid #fecaca;
}

.btn-publish-action:hover,
.btn-reply-action:hover,
.btn-delete-action:hover {
    transform: translateY(-1px);
}

/* ─── Publish Success / Share Prompt ─── */
.publish-success {
    align-items: center;
    text-align: center;
    animation: publishSuccessFade 0.35s ease;
}

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

.publish-success-text {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.btn-share-stories {
    width: 100%;
    padding: 14px;
    border-radius: var(--r-pill);
    border: none;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 40%, #7c3aed 100%);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.btn-share-stories:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
}

.btn-share-stories:active {
    transform: scale(0.97);
}

.btn-share-done {
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 16px;
    transition: color var(--t);
}

.btn-share-done:hover {
    color: var(--text-secondary);
}

/* =====================
   TOAST
   ===================== */
.toast {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(26, 26, 26, 0.9);
    color: white;
    padding: 10px 22px;
    border-radius: var(--r-pill);
    font-size: 0.88rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}

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

.toast.premium-toast {
    width: min(330px, calc(100% - 36px));
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(192, 132, 252, 0.65);
    border-radius: 12px;
    background: rgba(31, 20, 43, 0.96);
    white-space: normal;
}

.premium-toast-star {
    flex: 0 0 auto;
    color: #d8b4fe;
    font-size: 1.05rem;
}

.toast.premium-toast strong,
.toast.premium-toast small {
    display: block;
    text-align: left;
}

.toast.premium-toast strong {
    font-size: 0.8rem;
    line-height: 1.2;
}

.toast.premium-toast small {
    margin-top: 2px;
    color: #ddd6fe;
    font-size: 0.7rem;
    line-height: 1.2;
}

