/* =============================================
   NoteShare – style.css
   Tone: Orange + White | Light Theme
   ============================================= */

/* ---------- Google Fonts & Reset ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --orange-600: #ea6c0b;
    --orange-700: #c2570a;

    --accent: #ff6b35;
    --accent-light: #ff8c5a;
    --accent-dark: #e55a28;
    --accent-bg: #fff4ef;
    --accent-soft: #ffede5;

    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;

    --text-primary: #1a1a1a;
    --text-secondary: #525252;
    --text-muted: #a0a0a0;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, .07), 0 2px 4px rgba(0, 0, 0, .06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, .10), 0 4px 8px rgba(0, 0, 0, .06);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, .12), 0 8px 16px rgba(0, 0, 0, .07);
    --shadow-accent: 0 4px 20px rgba(255, 107, 53, .25);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --transition: all .2s cubic-bezier(.4, 0, .2, 1);
    --transition-slow: all .35s cubic-bezier(.4, 0, .2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============ HEADER ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(255, 107, 53, .12);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .05);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    opacity: .85;
    transform: translateY(-1px);
}

.logo-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--orange-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -.3px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: .9rem;
    font-weight: 500;
    padding: .4rem .75rem;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-new-note {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
    background: linear-gradient(135deg, var(--accent), var(--orange-600));
    color: white;
    font-size: .875rem;
    font-weight: 600;
    padding: .55rem 1.1rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-accent);
    transition: var(--transition);
}

.btn-new-note:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255, 107, 53, .35);
}

/* ============ HERO ============ */
.hero {
    background: linear-gradient(135deg, var(--orange-50) 0%, #fff7f4 50%, var(--white) 100%);
    border-bottom: 1px solid var(--orange-100);
    padding: 3.5rem 1.5rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(255, 107, 53, .08) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 80%, rgba(249, 115, 22, .06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 750px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--white);
    border: 1.5px solid var(--orange-200);
    color: var(--accent);
    font-size: .8rem;
    font-weight: 600;
    padding: .35rem .9rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    animation: fadeInDown .5s ease both;
}

.hero-title {
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: 1rem;
    animation: fadeInUp .55s ease .1s both;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.65;
    animation: fadeInUp .6s ease .2s both;
}

/* ============ CONTAINER ============ */
.container {
    width: 1200px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    flex: 1;
}

/* ============ EDITOR CARD ============ */
.editor-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 107, 53, .1);
    overflow: hidden;
    animation: slideUp .5s ease .25s both;
}

/* Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.25rem;
    background: var(--orange-50);
    border-bottom: 1px solid var(--orange-100);
    gap: 1rem;
}

.toolbar-left {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .85rem;
    border: 1.5px solid var(--orange-200);
    background: var(--white);
    color: var(--accent);
    font-size: .82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.tool-btn:hover {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(255, 107, 53, .25);
    transform: translateY(-1px);
}

.char-count {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* Textarea */
.note-textarea {
    width: 100%;
    min-height: 500px;
    max-height: 80vh;
    padding: 1.5rem 1.5rem;
    border: none;
    outline: none;
    font-family: 'Inter', 'Segoe UI', monospace;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--white);
    resize: vertical;
    transition: background .2s;
    display: block;
}

.note-textarea::placeholder {
    color: var(--gray-300);
}

.note-textarea:focus {
    background: #fffcfa;
}

/* Shake animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

.note-textarea.shake {
    animation: shake .4s ease;
    border: 2px solid var(--accent) !important;
}

/* Options row */
.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.option-group {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 1;
    min-width: 180px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.option-select,
.option-input {
    flex: 1;
    padding: .45rem .75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    transition: var(--transition);
}

.option-select:focus,
.option-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, .12);
}

/* Submit row */
.submit-row {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-save {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    background: linear-gradient(135deg, var(--accent), var(--orange-600));
    color: var(--white);
    border: none;
    padding: .85rem 2rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    box-shadow: var(--shadow-accent);
    transition: var(--transition);
    text-decoration: none;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 107, 53, .38);
}

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

.btn-save.loading {
    opacity: .7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.submit-note {
    font-size: .8rem;
    color: var(--text-muted);
}

/* ============ HOW IT WORKS ============ */
.how-it-works {
    margin-top: 3.5rem;
}

.section-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.75rem;
    letter-spacing: -.4px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.step-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem;
    text-align: center;
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition-slow);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--orange-200);
}

.step-num {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent), var(--orange-600));
    color: white;
    font-size: .75rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 107, 53, .3);
}

.step-icon {
    font-size: 2.2rem;
    margin-bottom: .75rem;
    margin-top: .25rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: .4rem;
}

.step-card p {
    font-size: .85rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ============ NOTE VIEW ============ */
.note-view-container {
    padding-top: 2rem;
}

.not-found-card {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    max-width: 480px;
    margin: 2rem auto;
}

.not-found-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.not-found-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: .5rem;
    color: var(--gray-800);
}

.not-found-card p {
    color: var(--text-muted);
    font-size: .95rem;
}

/* Note header bar */
.note-header-bar {
    margin-bottom: 1.25rem;
    animation: fadeInUp .4s ease both;
}

.note-title-display {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -.4px;
    margin-bottom: .6rem;
    line-height: 1.3;
}

.note-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .7rem;
    border-radius: var(--radius-full);
    font-size: .78rem;
    font-weight: 500;
    background: var(--gray-100);
    color: var(--text-secondary);
}

.meta-expire {
    background: #fff3cd;
    color: #9a6700;
}

.meta-forever {
    background: #d1fae5;
    color: #065f46;
}

/* Action bar */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1.25rem;
    animation: fadeInUp .45s ease .05s both;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .65rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: .875rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--orange-600));
    color: white;
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, .4);
}

.btn-primary.btn-copied {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, .3);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-secondary);
    border: 1.5px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    color: var(--accent);
    border-color: var(--orange-200);
    background: var(--accent-soft);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, .12);
}

/* Share URL box */
.share-url-box {
    background: linear-gradient(135deg, var(--orange-50), #fff7f5);
    border: 1.5px solid var(--orange-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    animation: fadeInUp .5s ease .1s both;
}

.share-url-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: .6rem;
}

.share-url-row {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.share-url-input {
    flex: 1;
    padding: .6rem .9rem;
    border: 1.5px solid var(--orange-200);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-family: 'Inter', monospace;
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    cursor: text;
    transition: var(--transition);
}

.share-url-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, .12);
}

.share-url-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.share-url-copy-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* Stats bar */
.note-stats-bar {
    display: flex;
    gap: .6rem;
    align-items: center;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
    padding-left: .25rem;
    font-weight: 500;
    animation: fadeInUp .5s ease .15s both;
}

/* Note content */
.note-content-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: fadeInUp .55s ease .2s both;
}

.note-content-pre {
    padding: 1.75rem;
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    font-size: .975rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    min-height: 180px;
    tab-size: 4;
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--gray-900);
    color: white;
    padding: .75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: .9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    z-index: 9999;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease;
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
}

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

.toast-success {
    background: #1a1a1a;
}

/* ============ FOOTER ============ */
.footer {
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    text-align: center;
    padding: 1.5rem;
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: auto;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 1rem;
    }

    .hero {
        padding: 2.5rem 1rem 2rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .container {
        padding: 1.25rem 1rem 3rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .editor-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

    .options-row {
        flex-direction: column;
    }

    .option-group {
        min-width: unset;
    }

    .action-bar {
        gap: .5rem;
    }

    .action-btn {
        padding: .6rem .9rem;
        font-size: .82rem;
    }

    .note-title-display {
        font-size: 1.2rem;
    }

    .share-url-row {
        flex-direction: column;
    }

    .share-url-copy-btn {
        width: 100%;
        justify-content: center;
    }

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

    .btn-save {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .logo-text {
        font-size: 1.05rem;
    }

    .toolbar-left {
        flex-wrap: wrap;
    }

    .note-stats-bar {
        flex-wrap: wrap;
        gap: .35rem;
    }
}

/* ============ EDIT PAGE HERO ============ */
.edit-hero {
    background: linear-gradient(135deg, #fff4ef 0%, #fff9f5 60%, var(--white) 100%);
    border-bottom: 1px solid var(--orange-100);
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
}

.edit-hero-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.edit-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--white);
    border: 1.5px solid var(--orange-200);
    color: var(--accent);
    font-size: .78rem;
    font-weight: 600;
    padding: .3rem .85rem;
    border-radius: var(--radius-full);
    margin-bottom: .85rem;
    box-shadow: var(--shadow-sm);
}

.edit-hero-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -.4px;
    margin-bottom: .35rem;
}

.edit-hero-sub {
    font-size: .85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.note-id-badge {
    font-family: 'Courier New', monospace;
    background: var(--orange-50);
    border: 1px solid var(--orange-200);
    color: var(--accent);
    font-size: .8rem;
    padding: .1rem .5rem;
    border-radius: var(--radius-sm);
}

/* ============ EDIT BUTTON (action bar) ============ */
.btn-edit {
    background: var(--white);
    color: #2563eb;
    border: 1.5px solid #bfdbfe;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.btn-edit:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .15);
}

/* ============ CANCEL EDIT BUTTON ============ */
.btn-cancel-edit {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: .875rem;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-secondary);
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.btn-cancel-edit:hover {
    color: #c0392b;
    border-color: #fca5a5;
    background: #fff1f0;
}

/* ============ EDITED META BADGE ============ */
.meta-edited {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* ============ CLEAR PASSWORD CHECKBOX ============ */
.clear-pass-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    font-weight: 500;
    color: #e74c3c;
    margin-left: .5rem;
    cursor: pointer;
    white-space: nowrap;
}

.clear-pass-label input[type="checkbox"] {
    accent-color: #e74c3c;
    cursor: pointer;
}

/* ============ PASSWORD INPUT (create form) ============ */
.options-row-password {

    border-top: 1px dashed var(--orange-200);
    background: #fffaf7;
}

.password-input-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
}

.password-input-wrap .option-input {
    padding-right: 2.5rem;
}

.toggle-pass-btn {
    position: absolute;
    right: .5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: .2rem;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: var(--font);
}

.toggle-pass-btn:hover {
    color: var(--accent);
}

.pass-hint {
    font-size: .75rem;
    font-weight: 600;
    margin-left: .5rem;
    white-space: nowrap;
    transition: var(--transition);
}

.hint-weak {
    color: #e74c3c;
}

.hint-medium {
    color: #f39c12;
}

.hint-strong {
    color: #27ae60;
}

/* ============ PASSWORD GATE (view page) ============ */
.password-gate-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
}

.password-gate-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--orange-100);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: slideUp .4s ease both;
}

.gate-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInDown .4s ease both;
}

.gate-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: .5rem;
    letter-spacing: -.3px;
}

.gate-subtitle {
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.55;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.gate-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.gate-input {
    width: 100%;
    padding: .8rem 2.75rem .8rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--gray-50);
    outline: none;
    transition: var(--transition);
}

.gate-input:focus {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, .12);
}

.gate-input-wrap .toggle-pass-btn {
    position: absolute;
    right: .75rem;
}

.gate-submit {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: .9rem;
}

.gate-back {
    display: block;
    margin-top: 1.25rem;
    font-size: .85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.gate-back:hover {
    color: var(--accent);
}

/* ============ NOTE TITLE ROW (lock badge) ============ */
.note-title-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .6rem;
}

.lock-badge {
    font-size: 1rem;
    flex-shrink: 0;
    cursor: default;
}

/* Creator badge */
.meta-creator {
    background: linear-gradient(135deg, #fff4ef, #ffe8dc);
    color: var(--accent);
    border: 1px solid var(--orange-200);
}

/* ============ DELETE BUTTON ============ */
.btn-danger {
    background: var(--white);
    color: #e74c3c;
    border: 1.5px solid #fca5a5;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #fff1f0;
    border-color: #e74c3c;
    color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, .15);
}

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

/* ============ SUCCESS banner on index (after delete) ============ */
.sec-success-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.25rem;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: var(--radius-md);
    color: #166534;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    animation: fadeInDown .35s ease both;
}

/* ============ SECURITY ERROR BANNER ============ */
.sec-error-banner {

    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.25rem;
    background: #fff1f0;
    border: 1.5px solid #fca5a5;
    border-radius: var(--radius-md);
    color: #c0392b;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    animation: fadeInDown .35s ease both;
}

.sec-error-banner svg {
    flex-shrink: 0;
    color: #e74c3c;
}

.sec-error-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #e74c3c;
    font-size: 1rem;
    line-height: 1;
    padding: .1rem .3rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: var(--font);
}

.sec-error-close:hover {
    background: #fca5a5;
}

/* Rate limit warning on submit-note */
.submit-note {
    font-size: .8rem;
    color: var(--text-muted);
}

.submit-note strong {
    color: var(--accent);
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--orange-200);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--orange-400);
}

/* ============ SELECTION ============ */
::selection {
    background: rgba(255, 107, 53, .18);
    color: var(--accent-dark);
}

/* =========================================================
   CUSTOM NOTIFICATION SYSTEM (TOAST & MODAL)
   ========================================================= */

/* --- TOAST --- */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
    /* Let clicks pass through container */
}

@media (max-width: 640px) {
    #toast-container {
        bottom: 1.5rem;
        right: 1.5rem;
        left: 1.5rem;
    }
}

.rdg-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--white);
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-left: 5px solid transparent;
    pointer-events: auto;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.21, 1.02, 0.73, 1), opacity 0.4s ease;
    width: 380px;
    max-width: 100%;
}

.rdg-toast--show {
    transform: translateX(0);
    opacity: 1;
}

.rdg-toast--hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Types */
.rdg-toast--success {
    border-left-color: #22c55e;
}

.rdg-toast--success .rdg-toast__icon {
    color: #22c55e;
}

.rdg-toast--success .rdg-toast__bar {
    background: #22c55e;
}

.rdg-toast--error {
    border-left-color: #ef4444;
}

.rdg-toast--error .rdg-toast__icon {
    color: #ef4444;
}

.rdg-toast--error .rdg-toast__bar {
    background: #ef4444;
}

.rdg-toast--warning {
    border-left-color: #f59e0b;
}

.rdg-toast--warning .rdg-toast__icon {
    color: #f59e0b;
}

.rdg-toast--warning .rdg-toast__bar {
    background: #f59e0b;
}

.rdg-toast--info {
    border-left-color: #3b82f6;
}

.rdg-toast--info .rdg-toast__icon {
    color: #3b82f6;
}

.rdg-toast--info .rdg-toast__bar {
    background: #3b82f6;
}

.rdg-toast--copy {
    border-left-color: var(--accent);
}

.rdg-toast--copy .rdg-toast__icon {
    color: var(--accent);
}

.rdg-toast--copy .rdg-toast__bar {
    background: var(--accent);
}

.rdg-toast__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 2px;
}

.rdg-toast__body {
    flex: 1;
    min-width: 0;
}

.rdg-toast__msg {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.5;
    display: block;
}

.rdg-toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    margin: -0.25rem -0.25rem 0 0;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rdg-toast__close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.rdg-toast__bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
}

/* --- MODAL (SWEETALERT-STYLE) --- */
.rdg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rdg-modal-overlay--show {
    opacity: 1;
}

.rdg-modal-overlay--hide {
    opacity: 0;
}

.rdg-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    text-align: center;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.rdg-modal-overlay--show .rdg-modal {
    transform: scale(1) translateY(0);
}

.rdg-modal--hide {
    transform: scale(0.95) translateY(10px);
}

.rdg-modal__icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.rdg-modal__icon svg {
    width: 32px;
    height: 32px;
}

.rdg-modal__icon--danger {
    background: #fee2e2;
    color: #ef4444;
}

.rdg-modal__icon--warning {
    background: #fef3c7;
    color: #f59e0b;
}

.rdg-modal__icon--question {
    background: #e0e7ff;
    color: #6366f1;
}

.rdg-modal__icon--info {
    background: #dbeafe;
    color: #3b82f6;
}

.rdg-modal__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.rdg-modal__text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.75rem;
    white-space: pre-wrap;
}

.rdg-modal__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.rdg-modal__btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    font-family: var(--font);
}

.rdg-modal__btn--cancel {
    background: var(--gray-100);
    color: var(--gray-700);
}

.rdg-modal__btn--cancel:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.rdg-modal__btn--confirm {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.25);
}

.rdg-modal__btn--confirm:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(255, 107, 53, 0.35);
}

.rdg-modal__btn--confirm.btn-danger {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
    border: none;
}

.rdg-modal__btn--confirm.btn-danger:hover {
    background: #dc2626;
    color: white;
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.35);
}

/* =========================================================
   Hide old banners (will be handled by notifications.js)
   ========================================================= */
.sec-error-banner[data-toast-type],
.sec-success-banner[data-toast-type] {
    display: none !important;
}