/* ==========================
   THEME VARIABLES
   ========================== */
:root {
    --primary: #3478f6;
    --primary-dark: #255cc9;
    --background: #f7f8fa;
    --surface: #fff;
    --border: #e4e9f2;
    --text: #222b45;
    --muted: #8f9bb3;
    --modal-bg: #fff;
    --modal-shadow: 0 6px 32px rgba(52,120,246,0.15), 0 1.5px 6px rgba(60,72,88,0.07);
    --modal-content-color: #38405a;
    --modal-note-bg: #fef9c3;
    --modal-note-border: #fde68a;
    --modal-note-color: #b45309;
}
body.dark-mode {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --background: #181c23;
    --surface: #232a36;
    --border: #283044;
    --text: #e4e9f2;
    --muted: #a0aec0;
    --modal-bg: #232a36;
    --modal-shadow: 0 6px 32px rgba(52,120,246,0.25), 0 1.5px 6px rgba(60,72,88,0.23);
    --modal-content-color: #dbeafe;
    --modal-note-bg: #413f1d;
    --modal-note-border: #bfae36;
    --modal-note-color: #ffe066;
}

/* ==========================
   RESET & BASE STYLES
   ========================== */
* { box-sizing: border-box; }

html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--background) !important;
    color: var(--text);
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

/* ==========================
   FLEXBOX LAYOUT FOR STICKY FOOTER
   ========================== */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
}
.page-content {
    flex: 1 0 auto;
}
.site-footer {
    flex-shrink: 0;
    background: var(--background);
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* ==========================
   HEADER & NAVIGATION
   ========================== */
.main-header, .header-inner {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-bottom: 1px solid var(--border);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 62px;
    justify-content: space-between;
    padding: 0;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}
.site-title-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-right: 18px;
}
.site-title {
    font-family: inherit;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}
.nav-link {
    color: var(--text);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    transition: color 0.18s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-link:hover {
    color: var(--primary);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-right: 8px;
}
.icon {
    width: 22px;
    height: 22px;
    opacity: 0.65;
    cursor: pointer;
    transition: opacity 0.18s;
    display: flex;
    align-items: center;
    font-size: 1.2em;
}
.icon:hover { opacity: 1; }

/* ==========================
   MAIN CONTAINERS
   ========================== */
.container,
.public-archive-container {
    max-width: 900px;
    margin: 44px auto;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 4px 24px 0 rgba(52,120,246,0.07), 0 1.5px 6px 0 rgba(60,72,88,0.04);
    padding: 36px 36px 28px 36px;
    border: 1px solid var(--border);
    color: var(--text);
}
.public-archive-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
}

/* ==========================
   TYPOGRAPHY
   ========================== */
h1 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 10px 0;
    letter-spacing: -1px;
}
.subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 1.08rem;
    margin-bottom: 28px;
}
.form-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 4px;
    display: block;
}

/* ==========================
   FORMS & INPUTS
   ========================== */
input,
textarea,
select,
.public-search-box {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: 1.07em;
    background: var(--background);
    color: var(--text);
    margin-bottom: 18px;
    transition: border 0.18s;
    font-family: inherit;
}
input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    outline: none;
}
textarea {
    min-height: 140px;
    resize: vertical;
}

/* Form layout rows */
.form-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.form-row select {
    width: auto;
    min-width: 120px;
    margin-bottom: 0;
}
.form-row label {
    margin-bottom: 0;
    font-weight: 400;
}
.visibility-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

/* ==========================
   BUTTONS
   ========================== */
.btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    margin-top: 20px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 8px rgba(52,120,246,0.08);
    display: inline-block;
}
.btn:disabled {
    background: #d2d8e6;
    color: #fff;
    cursor: not-allowed;
}
.btn:hover:enabled {
    background: var(--primary-dark);
}

/* ==========================
   PUBLIC PASTE CARDS
   ========================== */
.paste-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(52,120,246,0.06);
    margin-bottom: 18px;
    padding: 20px 22px 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    color: var(--text);
}
.paste-card-title {
    font-size: 1.13em;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.paste-card-snippet {
    color: var(--modal-content-color);
    font-size: 1em;
    background: var(--background);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-family: 'Fira Mono', 'Consolas', monospace;
}
.paste-card-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.97em;
    color: var(--muted);
    margin-bottom: 0;
}
.paste-card-label {
    background: #f1f5fb;
    color: var(--primary);
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 0.93em;
    margin-left: 4px;
}
body.dark-mode .paste-card-label {
    background: #263c5a;
    color: var(--primary);
}
.paste-card-lock {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 1.2em;
}

/* ==========================
   PAGINATION
   ========================== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 30px 0 10px 0;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 7px 15px;
    border-radius: 6px;
    background: var(--background);
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.pagination .current {
    background: var(--primary);
    color: #fff;
}

/* ==========================
   FAQ sections
   ========================== */
.faq-section {
    margin: 36px 0 0 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.faq-item {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.faq-question {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    text-align: left;
    font-size: 1.13em;
    font-weight: 600;
    color: var(--primary);
    padding: 18px 0 18px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: color 0.2s;
    background: var(--surface);
}
.faq-question:hover,
.faq-question:focus {
    color: var(--primary-dark);
}
.faq-question .fa-chevron-right {
    transition: transform 0.25s;
    color: var(--muted);
    font-size: 1em;
}
.faq-item.open .faq-question .fa-chevron-right {
    transform: rotate(90deg);
    color: var(--primary);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    background: var(--background);
    color: var(--text);
    font-size: 1.02em;
    padding: 0 0;
    transition: max-height 0.3s cubic-bezier(.4,2,.6,1), padding 0.18s;
    line-height: 1.7;
}
.faq-item.open .faq-answer {
    padding: 0 0 16px 34px;
    max-height: 400px;
    transition: max-height 0.35s cubic-bezier(.4,2,.6,1), padding 0.18s;
}
.faq-answer a {
    color: var(--primary);
    text-decoration: underline;
}
.faq-answer a:hover {
    color: var(--primary-dark);
}
/* FAQ dark mode overrides */
body.dark-mode .faq-item {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
body.dark-mode .faq-question {
    color: var(--primary);
    background: var(--surface);
}
body.dark-mode .faq-question .fa-chevron-right {
    color: var(--muted);
}
body.dark-mode .faq-item.open .faq-question .fa-chevron-right {
    color: var(--primary);
}
body.dark-mode .faq-answer {
    background: var(--background);
    color: var(--text);
}

/* ==========================
   MODAL STYLES
   ========================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background: rgba(52, 120, 246, 0.10);
    backdrop-filter: blur(2px);
    transition: background 0.25s;
}
.modal-content {
    background: var(--modal-bg);
    color: var(--modal-content-color);
    margin: 60px auto;
    padding: 36px 34px 26px 34px;
    border-radius: 18px;
    width: 96%;
    max-width: 700px;
    box-shadow: var(--modal-shadow);
    position: relative;
    animation: modalFadeIn 0.35s cubic-bezier(.4,2,.6,1) both;
    font-size: 1.07em;
}
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.close {
    color: #b0b8c9;
    position: absolute;
    right: 22px;
    top: 18px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.18s, transform 0.18s;
    line-height: 1;
    z-index: 2;
    background: none;
    border: none;
    padding: 0;
}
.close:hover,
.close:focus {
    color: var(--primary);
    transform: scale(1.25) rotate(90deg);
    outline: none;
}
.modal-content h2 {
    margin-top: 0;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--primary);
    margin-bottom: 18px;
    text-align: left;
}
.modal-content h3 {
    font-size: 1.13em;
    color: var(--text);
    margin-bottom: 8px;
}
.modal-content p, .modal-content li, .modal-content ol, .modal-content ul {
    color: var(--modal-content-color);
    line-height: 1.7;
}
.modal-content ul, .modal-content ol {
    margin-left: 20px;
    margin-bottom: 16px;
}
.modal-content ul {
    list-style: disc;
    padding-left: 18px;
}
.modal-content ol {
    list-style: decimal;
    padding-left: 18px;
}
.modal-content b {
    color: var(--primary);
    font-weight: 600;
}
.modal-note {
    background: var(--modal-note-bg);
    border: 1px solid var(--modal-note-border);
    color: var(--modal-note-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 24px;
    font-size: 0.98em;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.modal-note-header {
    display: flex;
    align-items: center;
    font-weight: bold;
    gap: 8px;
}
.modal-note-message {
    padding-left: 28px;
    line-height: 1.4;
}

/* ==========================
   FOOTER
   ========================== */
.site-footer {
    width: 100%;
    background: var(--background);
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 0;
    font-size: 1.03em;
    flex-shrink: 0;
    color: var(--muted);
}
.footer-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0 16px 0;
    flex-wrap: wrap;
}
.footer-left {
    color: var(--muted);
    font-size: 1em;
    font-weight: 400;
}
.footer-right {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.18s;
    display: flex;
    align-items: center;
    font-size: 1em;
}
.footer-link:hover {
    color: var(--primary-dark);
}

/* ==========================
   SCROLLBAR
   ========================== */
::-webkit-scrollbar {
    width: 8px;
    background: var(--border);
}
::-webkit-scrollbar-thumb {
    background: #c5d6ee;
    border-radius: 8px;
}

/* ==========================
   VISIBILITY BUTTONS
   ========================== */
.visibility-btn-group {
    display: flex;
    gap: 8px;
}
.visibility-btn {
    padding: 8px 22px;
    border-radius: 8px;
    background: var(--background);
    color: var(--text);
    border: 1.5px solid var(--border);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border 0.18s;
    user-select: none;
    font-size: 1em;
}
input[type="radio"][name="visibility"]:checked + .visibility-btn {
    background: #eaf2fe;
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(52,120,246,0.07);
}
input[type="radio"][name="visibility"]:not(:checked) + .visibility-btn {
    background: var(--background);
    color: var(--muted);
    border-color: var(--border);
    opacity: 0.8;
}
input[type="radio"][name="visibility"]:disabled + .visibility-btn {
    opacity: 0.5;
    cursor: not-allowed;
}
/* For dark mode */
body.dark-mode .visibility-btn {
    background: #232a36;
    color: #a0aec0;
    border-color: #283044;
}
body.dark-mode input[type="radio"][name="visibility"]:checked + .visibility-btn {
    background: #1e293b;
    color: #3b82f6;
    border-color: #3b82f6;
}

/* ==========================
   RESPONSIVE DESIGN
   ========================== */
@media (max-width: 900px) {
    .container, .public-archive-container {
        max-width: 98vw;
        padding: 18px 6vw 18px 6vw;
    }
    .header-inner, .footer-inner {
        max-width: 98vw;
        padding: 0 6vw;
    }
    .header-left {
        gap: 12px;
    }
    .main-nav {
        gap: 10px;
    }
    .header-right {
        gap: 12px;
    }
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 18px 6vw 16px 6vw;
    }
    .footer-right {
        gap: 14px;
    }
}
@media (max-width: 600px) {
    .modal-content {
        padding: 16px 4vw 12px 4vw;
        max-width: 99vw;
    }
    .close {
        right: 12px;
        top: 12px;
        font-size: 1.5rem;
    }
}

/* ==========================
   PASTE CARD FORM
   ========================== */
.paste-card-form {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 4px 24px 0 rgba(52,120,246,0.07), 0 1.5px 6px 0 rgba(60,72,88,0.04);
    border: 1px solid var(--border);
    padding: 36px 36px 28px 36px;
    max-width: 700px;
    margin: 44px auto;
}
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
}
textarea {
    min-height: 140px;
    resize: vertical;
    width: 100%;
    font-family: inherit;
}
.form-actions-row {
    display: flex;
    align-items: center;
    gap: 36px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.form-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-action-label {
    font-size: 1em;
    color: var(--muted);
    font-weight: 500;
    margin-right: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.action-select {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--background);
    color: var(--text);
    font-size: 1em;
    min-width: 90px;
}
.create-btn {
    padding: 12px 32px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    background: #aeb4be;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.18s;
    box-shadow: 0 2px 8px rgba(52,120,246,0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}
.create-btn:hover {
    background: var(--primary);
}

/* ==========================
   USERS MENU
   ========================== */
.user-menu-wrapper {
    position: relative;
    display: inline-block;
}
.user-menu-toggle {
    cursor: pointer;
    transition: color 0.18s;
}
.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 32px;
    min-width: 150px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 24px 0 rgba(52,120,246,0.07), 0 1.5px 6px 0 rgba(60,72,88,0.04);
    z-index: 100;
    padding: 8px 0;
}
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--text);
    text-decoration: none;
    font-size: 1em;
    transition: background 0.18s, color 0.18s;
}
.user-menu-item:hover {
    background: var(--background);
    color: var(--primary);
}
.user-menu-wrapper[data-menu-open="true"] .user-menu-dropdown {
    display: block;
}


/* Skip to content link (accessibility) */
.skip-link {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    background: var(--surface);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    margin: 8px;
    display: inline-block;
}

/* Site title link icon */
.site-title-link i.fa-paste {
    color: var(--primary);
    margin-right: 8px;
}

/* Footer link icon */
.footer-link i.fa-flag {
    margin-right: 4px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 18px;
}
.footer-link.back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    transition: background 0.18s, transform 0.18s, opacity 0.18s;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
}
.footer-link.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}
.footer-link.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}
.footer-link.back-to-top i {
    font-size: 1em;
}

html {
    scroll-behavior: smooth;
}
