:root {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --primary: #58a6ff;
    --primary-hover: #79c0ff;
    --accent: #238636;
    --accent-hover: #2ea043;
    --danger: #f85149;
    --radius: 8px;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    font-family: var(--font-mono);
}

.logo:hover {
    color: var(--primary-hover);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    background: var(--border);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
}

.btn-lg {
    padding: 10px 24px;
    font-size: 1rem;
}

/* Forms */
.input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.15s ease;
    font-family: inherit;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.textarea {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 300px;
    line-height: 1.5;
    tab-size: 4;
}

.label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.flex-grow {
    flex: 3 !important;
}

/* Hero */
.hero {
    text-align: center;
    padding: 40px 0 30px;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* Paste view */
.paste-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 0 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.paste-info h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

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

.paste-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Code block */
.code-wrapper {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.line-numbers {
    padding: 16px 12px;
    text-align: right;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    user-select: none;
    border-right: 1px solid var(--border);
    background: var(--bg);
    min-width: 50px;
}

.code-wrapper pre {
    flex: 1;
    margin: 0;
    padding: 16px;
    overflow-x: auto;
}

.code-wrapper code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    background: transparent !important;
    padding: 0 !important;
}

/* Share box */
.share-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}

.share-row {
    display: flex;
    gap: 8px;
}

.share-row .input {
    flex: 1;
}

.qr-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.qr-section canvas {
    border-radius: 6px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Recent pastes */
.recent-pastes {
    margin-top: 40px;
    padding-bottom: 40px;
}

.recent-pastes h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.paste-list {
    display: grid;
    gap: 8px;
}

.paste-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s ease;
}

.paste-card:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.paste-card-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.paste-card-meta {
    display: flex;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    align-items: center;
}

/* Password page */
.password-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 0;
}

.password-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.password-card h2 {
    margin-bottom: 8px;
}

.password-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 80px 0;
}

.error-page h1 {
    font-size: 5rem;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 12px;
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 1.1rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Admin panel */
.admin-panel {
    padding: 24px 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-header h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #da3633;
    border-color: #da3633;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th,
.admin-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table th {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover td {
    background: var(--bg-secondary);
}

.admin-table a {
    color: var(--primary);
    text-decoration: none;
}

.admin-table a:hover {
    text-decoration: underline;
}

.alert-success {
    background: rgba(35, 134, 54, 0.1);
    border: 1px solid var(--accent);
    color: #3fb950;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.edit-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.edit-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.edit-actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

/* Footer */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

main {
    flex: 1;
}

/* Responsive */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.5rem; }
    .form-row { flex-direction: column; }
    .paste-header { flex-direction: column; }
    .paste-card { flex-direction: column; align-items: flex-start; gap: 8px; }
    .paste-actions { width: 100%; }
    .paste-actions .btn { flex: 1; justify-content: center; }
}
