/* =====================================================
   PasteBin.site – Clean Global Styles (V3.0)
   ===================================================== */
:root {
    --bg-primary: #f5f6f8;
    --bg-secondary: #ffffff;
    --bg-header: #1f2937;
    --text-primary: #333;
    --text-secondary: #e5e7eb;
    --text-link: #2563eb;
    --text-link-hover: #fff;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --border-radius: 12px;
    --bg-alt: #f3f4f6;
    --bg-zebra: #f9fafb;
    --row-hover: #e5e7eb;
    --spacing-xs: 6px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Layout */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--spacing-lg) 0;
}

main.container {
    min-height: calc(100vh - 160px);
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.layout-grid .content {
    min-width: 0;
}

/* Header / Navbar */
header {
    background: var(--bg-header);
    color: #fff;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.navbar-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    flex: 0 0 auto;
}

.logo-text {
    font-size: 21px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.4px;
}

.logo-text span {
    color: var(--text-link);
}

.logo:hover .logo-text span {
    color: #fff;
}

.logo-mark {
    overflow: visible;
}

.logo-mark .lm-paper, .logo-mark .lm-clip {
    fill: none;
    stroke: var(--text-link);
    stroke-width: 2;
}

.logo-mark .lm-clip {
    stroke: #fff;
}

.logo-mark .lm-line {
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    transform-box: fill-box;
    transform-origin: left center;
    transform: scaleX(0);
    animation: lmDraw 0.6s ease forwards;
}

.logo-mark .l1 { animation-delay: 0.15s; }
.logo-mark .l2 { animation-delay: 0.35s; }
.logo-mark .l3 { animation-delay: 0.55s; }

.logo-mark .lm-caret {
    fill: var(--text-link);
    animation: lmBlink 1.1s steps(2) infinite;
    animation-delay: 0.8s;
}

.logo:hover .lm-paper { stroke: #fff; }
.logo:hover .lm-caret { fill: #fff; }

@keyframes lmDraw { to { transform: scaleX(1); } }
@keyframes lmBlink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .logo-mark .lm-line { animation: none; transform: scaleX(1); }
    .logo-mark .lm-caret { animation: none; }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.nav-links a {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 0;
    transition: color 0.2s;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--text-link);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-links a:hover { color: #fff; }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-cta {
    background: var(--text-link);
    color: #fff !important;
    padding: 7px 14px;
    border-radius: 6px;
}

.nav-cta::after { display: none; }
.nav-cta:hover { background: #1d4ed8; }

.nav-toggle {
    display: none;
    font-size: 22px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

/* Account Dropdown */
.nav-account {
    position: relative;
    flex: 0 0 auto;
}

.account-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid transparent;
    color: #fff;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.account-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}

.avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--text-link);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.account-name { font-size: 14px; font-weight: 600; }
.caret { font-size: 11px; opacity: 0.7; transition: transform 0.2s; }
.account-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    z-index: 50;
}

.dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown a, .dropdown-logout {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border-radius: 7px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.dropdown a:hover, .dropdown-logout:hover { background: var(--bg-alt); }
.dropdown-sep { height: 1px; background: var(--border-color); margin: 5px 0; }
.dropdown-logout { color: #dc2626; font-weight: 600; }

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
}

.sidebar h3 {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: 18px;
}

.sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-list li {
    padding: var(--spacing-xs) 0;
}

.sidebar-list a,
.sidebar-footer .view-all {
    color: var(--text-link);
    text-decoration: none;
    font-weight: 500;
}

.sidebar-list a:hover,
.sidebar-footer .view-all:hover {
    text-decoration: underline;
}

.sidebar-footer {
    margin-top: var(--spacing-sm);
    text-align: right;
}

.sidebar-footer .view-all {
    font-size: 14px;
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--bg-header);
    color: var(--text-secondary);
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

.footer h3 {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 12px;
    font-weight: 600;
}

.footer-about {
    max-width: 800px;
    margin: 0 auto 30px auto;
    text-align: center;
    line-height: 1.6;
    font-size: 14px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 30px;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: #ffffff;
}

.footer-copyright {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--text-link);
    color: #ffffff;
    padding: 10px 18px;
    min-height: 40px;
    min-width: 90px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #1d4ed8;
}

.btn-small {
    padding: 8px 14px;
    min-width: 80px;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-copy {
    background: #374151;
}

.btn-copy:hover {
    background: var(--bg-header);
}

/* Alerts */
.alert {
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--text-link);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    margin-top: 15px;
}

/* Home / Paste List */
.paste-list {
    list-style: none;
    margin-top: 20px;
}

.paste-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s ease;
}

.paste-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.paste-item h3 {
    margin-bottom: 4px;
}

.paste-item h3 a {
    color: var(--text-link);
    text-decoration: none;
}

.paste-item h3 a:hover {
    text-decoration: underline;
}

.meta {
    font-size: 13px;
    color: #6b7280;
    margin: 6px 0;
}

.excerpt {
    margin: 10px 0;
    color: #374151;
}

/* Paste View */
.paste-actions {
    margin: 10px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

pre.paste-content {
    background: #111827;
    color: #e5e7eb;
    padding: var(--spacing-md);
    border-radius: 6px;
    margin-top: 15px;
    font-size: 13px;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

pre.paste-content code {
    white-space: inherit;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
}

/* Admin */
.admin-header {
    background: #111827;
    color: #fff;
    padding: 15px 0;
}

.admin-user {
    font-size: 14px;
}

.admin-login {
    max-width: 400px;
    margin: 80px auto;
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-box h3 {
    margin-bottom: 8px;
    font-size: 16px;
    color: #374151;
}

.stat-box p {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-link);
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-table th,
.admin-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.admin-table th {
    background: var(--bg-alt);
    font-weight: 600;
}

.admin-table tbody tr:nth-child(even) {
    background: var(--bg-zebra);
}

.admin-table tr:hover {
    background: var(--row-hover) !important;
}

/* Toast */
#pbToast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #111827;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    pointer-events: none;
}

#pbToast.show {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   MOBILE RESPONSIVE (Clean, Single Block)
   ===================================================== */
@media (max-width: 768px) {
    .container {
        width: 94%;
        padding: 14px 0;
    }
    
    h1 { font-size: 22px; line-height: 1.3; }
    h2 { font-size: 18px; }
    
    main.container {
        min-height: auto !important;
        height: auto !important;
    }
    
    .layout-grid {
        display: block !important;
    }
    
    .layout-grid .content {
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    .layout-grid .sidebar {
        margin-top: 20px;
        width: 100%;
    }
    
    .nav-toggle { display: block; }
    
    .navbar-inner {
        flex-wrap: wrap;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-top: 10px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        display: block;
        padding: 10px;
        border-radius: 4px;
        background: #111827;
    }
    
    .nav-account {
        order: 99;
        width: 100%;
        margin-top: 10px;
    }
    
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        display: none;
        padding: 0 0 0 12px;
    }
    
    .dropdown.open { display: block; }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
    }
    
    textarea {
        min-height: 150px;
    }
    
    .form-actions {
        margin-top: 12px;
    }
    
    .form-actions .btn {
        flex: 1;
        padding: 10px;
        font-size: 14px;
        min-width: auto;
    }
    
    .paste-actions .btn {
        flex: 1;
        padding: 10px;
        font-size: 14px;
        min-width: auto;
    }
    
    .paste-item {
        padding: 14px;
    }
    
    .paste-item h3 {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .excerpt { font-size: 14px; }
    
    .admin-login {
        margin: 40px 15px;
        padding: 20px;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 14px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 6px;
    }
}
/* =====================================================
   V3.0 — Advanced Recent Pastes List & AJAX
   ===================================================== */
.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.recent-header h1 { margin: 0; font-size: 24px; }

.recent-search { display: flex; gap: 8px; }
.recent-search input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    width: 220px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Advanced Paste Item */
.paste-list.advanced-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.paste-item.advanced-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.paste-item.advanced-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--text-link);
}

.paste-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.paste-item-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.paste-item-header h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.paste-item-header h3 a:hover { color: var(--text-link); }

.paste-excerpt {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.paste-meta-advanced {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.paste-meta-advanced span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* AJAX Loader */
.ajax-container { transition: opacity 0.15s ease; position: relative; }

.ajax-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-link);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

/* Advanced Pagination Polish */
.advanced-pagination { margin-top: 24px; display: flex; justify-content: center; }

.pagination-list {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.pagination-link:hover {
    background: var(--bg-alt);
    border-color: var(--border-color);
}

.pagination-link.active {
    background: var(--text-link);
    color: #fff;
    border-color: var(--text-link);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--text-muted);
}

/* Ad Container Polish */
.ad-container-bottom {
    width: 310px;
    height: 260px;
    margin: 24px auto;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .recent-header { flex-direction: column; align-items: stretch; }
    .recent-search { width: 100%; }
    .recent-search input { flex: 1; width: 100%; }
    .paste-item-header { flex-direction: column; gap: 8px; }
    .paste-meta-advanced { gap: 12px; }
    .pagination-list { flex-wrap: wrap; justify-content: center; }
}

/* V3.1 — Ensure [hidden] beats .ajax-loader's display:flex */
.ajax-loader[hidden] { display: none !important; }
