/* ===== TurboNeko Blog Admin — admin.css ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
    --bg: #0A0A14;
    --bg-card: #12121E;
    --bg-input: #1A1A2E;
    --bg-hover: #1E1E32;
    --primary: #8B5CF6;
    --primary-light: #A78BFA;
    --cyan: #38BDF8;
    --green: #34D399;
    --red: #EF4444;
    --yellow: #FBBF24;
    --text: #F1F0FB;
    --text-dim: #9CA3AF;
    --text-muted: #6B7280;
    --border: rgba(255,255,255,0.08);
    --border-focus: rgba(139,92,246,0.4);
}

body {
    font-family: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ===== Login Page ===== */
.login-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139,92,246,0.08), transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(56,189,248,0.06), transparent 50%);
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 36px 40px;
    backdrop-filter: blur(20px);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    height: 48px;
    width: auto;
    margin-bottom: 12px;
    filter: brightness(1.3);
}

.login-logo h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-logo h1 .gradient {
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
}

/* ===== Form ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.25s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

.form-group input::placeholder { color: var(--text-muted); }
.form-group select { cursor: pointer; }

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: white;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(139,92,246,0.25);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-light); }

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: var(--red);
    border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 8px 16px; font-size: 12px; width: auto; }

/* ===== Message ===== */
.msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}
.msg.error { display: block; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #FCA5A5; }
.msg.success { display: block; background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.2); color: var(--green); }

/* ===== Spinner ===== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Dashboard ===== */
.dashboard { min-height: 100vh; }

.dash-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px; height: 64px;
    border-bottom: 1px solid var(--border);
    background: rgba(10,10,20,0.8);
    backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 100;
}

.dash-nav-left { display: flex; align-items: center; gap: 12px; }
.dash-nav-left img { height: 28px; width: auto; filter: brightness(1.3); }
.dash-nav-left span {
    font-size: 15px; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.dash-nav-right { display: flex; align-items: center; gap: 12px; }
.dash-user { font-size: 13px; color: var(--text-dim); }

.dash-container {
    max-width: 1200px; width: 100%; margin: 0 auto; padding: 32px;
}

/* ===== Stats ===== */
.dash-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px;
}
.stat-card .stat-number {
    font-size: 32px; font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; letter-spacing: 1px; text-transform: uppercase; }

/* ===== Tabs ===== */
.dash-tabs {
    display: flex; gap: 6px; margin-bottom: 24px;
    background: var(--bg-input); border-radius: 12px; padding: 4px;
    border: 1px solid var(--border);
}
.dash-tabs .tab {
    padding: 10px 24px; border: none; border-radius: 10px;
    background: transparent; color: var(--text-muted); font-size: 14px;
    font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: 0.3px;
}
.dash-tabs .tab:hover {
    color: var(--text-dim);
    background: rgba(255,255,255,0.04);
}
.dash-tabs .tab.active {
    background: var(--bg-card); color: var(--text);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
}
.dash-tab-content { display: none; }
.dash-tab-content.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ===== Toolbar ===== */
.dash-toolbar {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;
}
.dash-toolbar h2 { font-size: 18px; font-weight: 700; }

/* ===== Post List ===== */
.post-list { display: flex; flex-direction: column; gap: 12px; }

.post-item {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 20px; transition: border-color 0.25s;
}
.post-item:hover { border-color: rgba(139,92,246,0.15); }

.post-item-emoji {
    font-size: 28px; flex-shrink: 0;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(139,92,246,0.06); border-radius: 10px; border: 1px solid var(--border);
}

.post-item-info { flex: 1; min-width: 0; }
.post-item-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.post-item-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }

.post-item-category {
    display: inline-block; padding: 1px 8px; border-radius: 3px;
    font-size: 10px; font-weight: 600;
}
.post-item-category.dev { background: rgba(56,189,248,0.15); color: var(--cyan); }
.post-item-category.tech { background: rgba(139,92,246,0.15); color: var(--primary-light); }
.post-item-category.design { background: rgba(236,72,153,0.15); color: #EC4899; }
.post-item-category.life { background: rgba(52,211,153,0.15); color: var(--green); }

.post-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== User Management ===== */
.user-list { display: flex; flex-direction: column; gap: 12px; }

.user-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px 20px;
    display: flex; align-items: center; gap: 16px;
    transition: border-color 0.25s;
    flex-wrap: wrap;
}
.user-card:hover { border-color: rgba(139,92,246,0.15); }

.user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px; color: white; flex-shrink: 0;
}
.user-card-info { flex: 1; min-width: 150px; }
.user-card-name { font-weight: 600; font-size: 14px; }
.user-card-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.user-card-meta .badge {
    padding: 1px 10px; border-radius: 12px; font-size: 11px; font-weight: 500;
}
.badge-active { background: rgba(52,211,153,0.15); color: var(--green); }
.badge-frozen { background: rgba(251,191,36,0.15); color: var(--yellow); }
.badge-banned { background: rgba(239,68,68,0.15); color: var(--red); }

.user-card-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    padding: 36px; max-width: 640px; width: 100%;
    max-height: 90vh; overflow-y: auto; position: relative;
}

.modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-dim); font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s;
}
.modal-close:hover { border-color: var(--primary); color: var(--primary-light); }
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group textarea {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-input); color: var(--text);
    font-size: 13px; font-family: 'JetBrains Mono', monospace;
    outline: none; transition: border-color 0.25s;
    resize: vertical; min-height: 120px;
}
.form-group textarea:focus { border-color: var(--border-focus); }

.form-actions { display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end; }

/* ===== Confirm Dialog ===== */
.confirm-box { text-align: center; padding: 20px 0; }
.confirm-box .confirm-icon { font-size: 48px; margin-bottom: 16px; }
.confirm-box p { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

/* ===== Tags Input ===== */
.tags-input-wrapper {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-input); min-height: 44px; align-items: center;
    cursor: text;
}
.tags-input-wrapper .tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 4px; font-size: 12px;
    background: rgba(139,92,246,0.15); color: var(--primary-light);
}
.tags-input-wrapper .tag .remove {
    cursor: pointer; font-size: 14px; line-height: 1; opacity: 0.7; transition: opacity 0.2s;
}
.tags-input-wrapper .tag .remove:hover { opacity: 1; }
.tags-input-wrapper input {
    flex: 1; min-width: 80px; border: none; background: transparent;
    color: var(--text); font-size: 13px; font-family: inherit;
    outline: none; padding: 4px 0;
}

/* ===== Fade ===== */
.fade-up {
    opacity: 1; transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1);
}
.js-enabled .fade-up { opacity: 0; transform: translateY(40px); }
.js-enabled .fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up.delay-1 { transition-delay: 0.10s; }
.fade-up.delay-2 { transition-delay: 0.20s; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .login-card { padding: 36px 24px; }
    .form-row { grid-template-columns: 1fr; }
    .dash-stats { grid-template-columns: 1fr; }
    .dash-container { padding: 16px; }
    .post-item { flex-wrap: wrap; }
    .post-item-actions { width: 100%; justify-content: flex-end; }
    .modal { padding: 24px; }
    .dash-tabs .tab { padding: 8px 14px; font-size: 12px; }
    .user-card { flex-direction: column; align-items: stretch; }
    .user-card-actions { justify-content: flex-start; }
}