/* ============================================
   Community Hub - Main Stylesheet
   ============================================
   Dark theme with glassmorphism effects
   Inter font, purple-blue accent gradient
   ============================================ */

/* ---- CSS Custom Properties (Theme) ---- */
:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #0f0f1a;
    --bg-card: rgba(20, 20, 40, 0.7);
    --bg-card-hover: rgba(30, 30, 55, 0.8);
    --bg-input: rgba(15, 15, 30, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);

    --text-primary: #e8e8f0;
    --text-secondary: #8888a8;
    --text-muted: #55557a;

    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --accent-glow: 0 0 20px rgba(108, 92, 231, 0.3);

    --success: #00cec9;
    --warning: #fdcb6e;
    --danger: #ff6b6b;
    --info: #74b9ff;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(108, 92, 231, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --navbar-height: 64px;
    --max-width: 850px;
    --max-width-admin: 1100px;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(162, 155, 254, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 206, 201, 0.03) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent-primary);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
}

.nav-logo i {
    font-size: 1.4rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-logo strong {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-link.nav-admin {
    color: var(--warning);
}

.nav-link.nav-logout {
    color: var(--danger);
}

.nav-register-btn {
    background: var(--accent-gradient) !important;
    color: white !important;
    border-radius: var(--radius-md) !important;
}

.nav-register-btn:hover {
    box-shadow: var(--accent-glow);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--navbar-height) + 24px) 16px 40px;
    min-height: calc(100vh - 80px);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--accent-secondary);
    border: 1px solid var(--border-hover);
}

.btn-outline:hover {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.25);
}

.btn-success {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 206, 201, 0.2);
}

.btn-success:hover {
    background: rgba(0, 206, 201, 0.25);
}

.btn-warning {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
    border: 1px solid rgba(253, 203, 110, 0.2);
}

.btn-warning:hover {
    background: rgba(253, 203, 110, 0.25);
}

.btn-info {
    background: rgba(116, 185, 255, 0.15);
    color: var(--info);
    border: 1px solid rgba(116, 185, 255, 0.2);
}

.btn-info:hover {
    background: rgba(116, 185, 255, 0.25);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* ============================================
   AUTH PAGES (Login/Register)
   ============================================ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideUp 0.5s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: var(--accent-glow);
}

.auth-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-form .form-group label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-footer a {
    font-weight: 600;
}

/* ============================================
   CREATE POST
   ============================================ */
.create-post-section {
    margin-bottom: 24px;
}

.create-post-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}

.create-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.create-post-trigger {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.create-post-trigger:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.create-post-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    animation: fadeSlideDown 0.3s ease;
}

/* Post Type Selector */
.post-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.type-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.type-option input[type="radio"] {
    display: none;
}

.type-option.active,
.type-option:has(input:checked) {
    background: rgba(108, 92, 231, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

/* File Upload */
.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-label:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

.file-input-hidden {
    display: none;
}

/* Image Preview */
.image-preview {
    margin-top: 12px;
    position: relative;
    display: inline-block;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.image-preview img {
    max-height: 200px;
    border-radius: var(--radius-md);
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.remove-image:hover {
    background: var(--danger);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* ============================================
   FILTER TABS
   ============================================ */
.filter-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.filter-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.filter-tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--accent-glow);
}

/* ============================================
   POST CARDS
   ============================================ */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    animation: fadeSlideUp 0.4s ease;
}

.post-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

/* Post Header */
.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    flex-shrink: 0;
    overflow: hidden;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-info {
    display: flex;
    flex-direction: column;
}

.post-author-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-decoration: none;
}

.post-author-name:hover {
    color: var(--accent-secondary);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-type-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-post {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.badge-question {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.badge-meme {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}

/* Post Actions Dropdown */
.post-actions-menu {
    position: relative;
}

.post-actions-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.post-actions-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.post-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
    min-width: 150px;
    box-shadow: var(--shadow-md);
    z-index: 100;
    display: none;
    animation: fadeSlideDown 0.2s ease;
}

.post-dropdown.show {
    display: block;
}

.post-dropdown button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.post-dropdown button:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.post-dropdown button.delete-btn:hover {
    color: var(--danger);
}

/* Post Content */
.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.post-content {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 12px;
    word-break: break-word;
}

.post-image {
    margin: 12px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.post-image img {
    width: 100%;
    display: block;
    transition: var(--transition);
}

.post-image img:hover {
    transform: scale(1.02);
}

/* Post Footer (Like, Comment buttons) */
.post-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.post-action-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.post-action-btn.liked {
    color: var(--danger);
}

.post-action-btn.liked i {
    animation: likeAnimation 0.4s ease;
}

/* ============================================
   COMMENTS
   ============================================ */
.comments-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.comment-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-top: 2px;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.comment-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    transition: var(--transition-fast);
}

.comment-delete:hover {
    color: var(--danger);
}

.comment-form {
    display: flex;
    gap: 8px;
}

.comment-form input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.comment-form input:focus {
    border-color: var(--accent-primary);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: fadeSlideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-layout {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-container {
    flex: 1;
    max-width: var(--max-width);
}

.profile-header-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 24px;
    position: relative;
}

.profile-cover {
    height: 120px;
    background: var(--accent-gradient);
    position: relative;
}

.profile-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-card));
}

.profile-info {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 0 24px;
    margin-top: -40px;
    position: relative;
    z-index: 1;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    border: 3px solid var(--bg-card);
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-placeholder-large {
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-details {
    padding-bottom: 8px;
}

.profile-username {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-bio {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.profile-joined {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Profile Stats */
.profile-stats {
    display: flex;
    gap: 24px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-secondary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Edit Profile */
.edit-profile-form {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-color);
    animation: fadeSlideDown 0.3s ease;
}

#editProfileBtn {
    margin: 0 24px 16px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}

.badge-user {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.badge-type-post {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.badge-type-question {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.badge-type-meme {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}

.badge-success {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

/* ============================================
   ADMIN PROFILE SIDEBAR
   ============================================ */
.admin-profile-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    height: fit-content;
    position: sticky;
    top: calc(var(--navbar-height) + 24px);
}

.admin-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-sidebar-header i {
    font-size: 1.1rem;
}

.admin-sidebar-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-sidebar-section:last-child {
    border-bottom: none;
}

.admin-sidebar-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.admin-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.status-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-detail-row i {
    width: 16px;
    color: var(--text-muted);
    text-align: center;
}

.admin-detail-row .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.admin-detail-row.highlight {
    background: var(--bg-glass);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin: 4px -12px;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.admin-stat-item {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
}

.admin-stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-secondary);
}

.admin-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-type-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.type-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.activity-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.activity-log-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
}

.activity-log-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.activity-log-icon.activity-post {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.activity-log-icon.activity-comment {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.activity-log-icon.activity-like {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

.activity-log-content {
    flex: 1;
    min-width: 0;
}

.activity-log-title {
    display: block;
    font-size: 0.8rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-log-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.admin-actions-section {
    background: var(--bg-secondary);
}

.admin-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-quick-actions .btn {
    justify-content: center;
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   ADMIN PAGES - ENHANCED LAYOUT
   ============================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
}

/* Hide navbar on admin pages with sidebar */
body:has(.admin-layout) .main-content {
    padding-top: 0;
    max-width: none;
}

body:has(.admin-layout) .navbar {
    display: none;
}

body:has(.admin-layout) .admin-layout {
    padding-top: 0;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-logo i {
    font-size: 1.4rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
}

.sidebar-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-gradient);
    color: white;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-badge {
    margin-left: auto;
    background: rgba(108, 92, 231, 0.2);
    color: var(--accent-gradient);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.sidebar-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sidebar-stat strong {
    margin-left: auto;
    color: var(--text-primary);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
}

/* Main Admin Content */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 0 24px 40px;
    min-height: 100vh;
}

/* Topbar */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    border-color: var(--accent-primary);
}

.topbar-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.topbar-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Enhanced Stats Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card-enhanced {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-gradient-purple::before { background: linear-gradient(90deg, #6c5ce7, #a29bfe); }
.stat-gradient-blue::before { background: linear-gradient(90deg, #74b9ff, #0984e3); }
.stat-gradient-green::before { background: linear-gradient(90deg, #00cec9, #00b894); }
.stat-gradient-orange::before { background: linear-gradient(90deg, #fdcb6e, #f39c12); }

.stat-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon-box {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-gradient-purple .stat-icon-box {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.stat-gradient-blue .stat-icon-box {
    background: rgba(116, 185, 255, 0.15);
    color: var(--info);
}

.stat-gradient-green .stat-icon-box {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.stat-gradient-orange .stat-icon-box {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.trend-up {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.trend-down {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

.stat-mini-chart {
    position: absolute;
    right: 16px;
    bottom: 16px;
    font-size: 2rem;
    opacity: 0.15;
    color: var(--text-muted);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: var(--transition);
}

.action-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.action-icon-users {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.action-icon-posts {
    background: rgba(116, 185, 255, 0.15);
    color: var(--info);
}

.action-icon-site {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.action-text {
    flex: 1;
}

.action-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.action-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.action-arrow {
    color: var(--text-muted);
    transition: var(--transition);
}

.action-card:hover .action-arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.dashboard-card.card-wide {
    grid-column: span 2;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--accent-secondary);
}

.card-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-link {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.card-link:hover {
    color: var(--accent-primary);
}

.card-body {
    padding: 16px 20px;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.activity-post {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.activity-comment {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.activity-user {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-text strong {
    color: var(--accent-secondary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* User List */
.user-list {
    display: flex;
    flex-direction: column;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.user-item:last-child {
    border-bottom: none;
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Leaderboard */
.leaderboard {
    display: flex;
    flex-direction: column;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-glass);
    color: var(--text-muted);
}

.leaderboard-rank.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #000;
}

.leaderboard-rank.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #000;
}

.leaderboard-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
}

.leaderboard-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.leaderboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.leaderboard-posts {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Posts Table */
.posts-table {
    display: flex;
    flex-direction: column;
}

.post-row {
    display: grid;
    grid-template-columns: 180px 1fr 100px 100px;
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.post-row:last-child {
    border-bottom: none;
}

.post-author-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-author-info {
    display: flex;
    flex-direction: column;
}

.post-author-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.post-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-content-cell p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.post-meta-cell {
    text-align: center;
}

.post-stats-cell {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.post-stat {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-stat i {
    font-size: 0.75rem;
}

/* Text Colors */
.text-cyan { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* Legacy Admin Styles */
.admin-container {
    max-width: var(--max-width-admin);
    margin: 0 auto;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header p {
    color: var(--text-secondary);
    width: 100%;
}

/* Stats Grid Legacy */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-card-purple .stat-card-icon {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.stat-card-blue .stat-card-icon {
    background: rgba(116, 185, 255, 0.15);
    color: var(--info);
}

.stat-card-green .stat-card-icon {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.stat-card-orange .stat-card-icon {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}

.stat-card-cyan .stat-card-icon {
    background: rgba(0, 206, 201, 0.15);
    color: var(--success);
}

.stat-card-pink .stat-card-icon {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

.stat-card-number {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Quick Links Legacy */
.admin-quick-links {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.quick-link-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.quick-link-card:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.quick-link-card i {
    font-size: 1.2rem;
}

/* Admin Panels Legacy */
.admin-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-body {
    padding: 0;
    overflow-x: auto;
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    white-space: nowrap;
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--bg-glass);
}

/* Search Box */
.admin-search {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    position: relative;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--accent-primary);
}

.admin-filter select {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Enhanced Search Section */
.admin-search-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box-enhanced {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-box-enhanced i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box-enhanced input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.search-box-enhanced input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.search-box-enhanced input::placeholder {
    color: var(--text-muted);
}

.search-hint {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition);
}

.search-box-enhanced input:focus + .search-hint {
    opacity: 1;
}

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-pill:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

.filter-pill.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Table Container */
.table-container {
    overflow-x: auto;
}

.enhanced-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.enhanced-table th {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.enhanced-table tr:hover {
    background: var(--bg-glass);
}

.enhanced-table td {
    vertical-align: middle;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.no-posts-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-posts-message i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

.load-more-container {
    text-align: center;
    padding: 20px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 12px);
    right: 16px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 280px;
    animation: slideInRight 0.3s ease;
    font-size: 0.9rem;
}

.toast.toast-success {
    border-left: 3px solid var(--success);
}

.toast.toast-error {
    border-left: 3px solid var(--danger);
}

.toast.toast-info {
    border-left: 3px solid var(--info);
}

.toast-icon {
    font-size: 1rem;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-info .toast-icon {
    color: var(--info);
}

.toast.fade-out {
    animation: slideOutRight 0.3s ease forwards;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 24px 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.footer-brand i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes likeAnimation {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: rgba(10, 10, 20, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 12px;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-120%);
        transition: var(--transition);
        gap: 2px;
    }

    .nav-links.show {
        transform: translateY(0);
    }

    .nav-toggle {
        display: block;
    }

    .nav-link {
        padding: 12px 16px;
        justify-content: flex-start;
    }

    .admin-panels {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -30px;
    }

    .profile-stats {
        justify-content: center;
    }

    .profile-layout {
        flex-direction: column;
    }

    .admin-profile-sidebar {
        width: 100%;
        position: static;
        order: -1;
    }

    .admin-stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .activity-log {
        max-height: 200px;
    }

    .admin-quick-links {
        flex-direction: column;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .post-type-selector {
        flex-direction: column;
    }

    .toast {
        min-width: auto;
        right: 0;
    }

    .toast-container {
        left: 16px;
        right: 16px;
    }

    /* Admin Layout Mobile */
    .admin-layout {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        padding: 0 16px 40px;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card.card-wide {
        grid-column: span 1;
    }

    .post-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .post-content-cell {
        order: 2;
    }

    .post-meta-cell,
    .post-stats-cell {
        order: 3;
    }

    .admin-topbar {
        position: relative;
    }
    
    .admin-search-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-pills {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-tabs {
        overflow-x: auto;
    }

    .filter-tab span {
        display: none;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stat-card-enhanced {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .stat-icon-box {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .filter-pills {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-pill {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .admin-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}