/* ==========================================================================
   Global Variables & Reset
   ========================================================================== */
:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(51, 65, 85, 0.9);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-purple: #a855f7;
    --accent-green: #22c55e;
    --accent-line: #06c755;
    --accent-shopee: #ee4d2d;
    --font-thai: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-en: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-thai);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1.25rem 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Ambient Glow Effect */
.background-glow {
    position: fixed;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow-1, rgba(56, 189, 248, 0.2)) 0%, var(--glow-2, rgba(168, 85, 247, 0.15)) 40%, rgba(15, 23, 42, 0) 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Share Button */
.share-btn {
    position: absolute;
    top: -1.5rem;
    right: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.25s ease;
    backdrop-filter: blur(12px);
}

.share-btn:hover {
    background: var(--accent-blue);
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

/* Profile Header */
.profile-header {
    text-align: center;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-wrapper {
    position: relative;
    width: 105px;
    height: 105px;
    margin-bottom: 1rem;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
}

/* Status Indicator (Online/Ready) */
.status-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 16px;
    height: 16px;
    background-color: var(--accent-green);
    border: 3px solid var(--bg-dark);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
}

.verified-badge {
    color: var(--accent-blue);
    font-size: 1.1rem;
}

.profile-handle {
    font-family: var(--font-en);
    font-size: 0.95rem;
    color: var(--accent-blue);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.profile-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 440px;
    font-weight: 300;
}

/* Social Bar */
.social-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.social-icon.line:hover { background: #06c755; color: #fff; border-color: #06c755; }
.social-icon.fb:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.social-icon.ig:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%); color: #fff; }
.social-icon.tiktok:hover { background: #000; color: #fff; border-color: #fe2c55; }
.social-icon.email:hover { background: #ea4335; color: #fff; border-color: #ea4335; }

/* Links Section */
.links-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

/* Link Card */
.link-card {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    background: var(--card-hover);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Featured Card with Border Glow */
.link-card.featured {
    border: 1px solid rgba(6, 199, 85, 0.5);
    background: linear-gradient(135deg, rgba(6, 199, 85, 0.15) 0%, rgba(30, 41, 59, 0.8) 100%);
}

.link-card.featured:hover {
    border-color: rgba(6, 199, 85, 0.9);
    box-shadow: 0 8px 30px rgba(6, 199, 85, 0.25);
}

.card-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-right: 1rem;
    color: var(--accent-blue);
    transition: all 0.25s ease;
}

.link-card.featured .card-icon {
    color: var(--accent-line);
    background: rgba(6, 199, 85, 0.2);
}

.link-card:hover .card-icon {
    transform: scale(1.1);
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges / Tags */
.tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.tag.popular {
    background: rgba(6, 199, 85, 0.2);
    color: #4ade80;
    border: 1px solid rgba(6, 199, 85, 0.4);
}

.tag.sale {
    background: rgba(238, 77, 45, 0.2);
    color: #fb7185;
    border: 1px solid rgba(238, 77, 45, 0.4);
}

.arrow-icon {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 0.5rem;
    transition: transform 0.25s ease;
}

.link-card:hover .arrow-icon {
    transform: translateX(4px);
    color: var(--text-primary);
}

/* Footer */
.footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 2.5rem 1rem 1.5rem;
    }
    
    .profile-name {
        font-size: 1.35rem;
    }

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

    .card-desc {
        font-size: 0.8rem;
    }
}


/* ==========================================================================
   Auth & Admin Dashboard Components
   ========================================================================== */
.auth-box, .admin-box {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
    background: rgba(15, 23, 42, 0.85);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
    color: #0f172a;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: #ef4444;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Admin Dashboard Specific */
.admin-navbar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.admin-nav-actions {
    display: flex;
    gap: 0.5rem;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-blue);
}

.link-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.link-item-info {
    flex: 1;
    min-width: 0;
}

.link-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-item-url {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-item-actions {
    display: flex;
    gap: 0.4rem;
}


/* ==========================================================================
   Color Themes (data-theme)
   ========================================================================== */
/* 1. Midnight Neon (Default) */
[data-theme="midnight"], :root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(51, 65, 85, 0.9);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-purple: #a855f7;
    --glow-1: rgba(56, 189, 248, 0.22);
    --glow-2: rgba(168, 85, 247, 0.18);
}

/* 2. Emerald Forest */
[data-theme="emerald"] {
    --bg-dark: #091c16;
    --card-bg: rgba(16, 44, 35, 0.75);
    --card-border: rgba(52, 211, 153, 0.18);
    --card-hover: rgba(22, 65, 52, 0.9);
    --text-primary: #f0fdf4;
    --text-secondary: #86efac;
    --accent-blue: #34d399;
    --accent-purple: #10b981;
    --glow-1: rgba(16, 185, 129, 0.28);
    --glow-2: rgba(52, 211, 153, 0.2);
}

/* 3. Sunset Rose */
[data-theme="sunset"] {
    --bg-dark: #1a0b1c;
    --card-bg: rgba(45, 19, 48, 0.75);
    --card-border: rgba(244, 63, 94, 0.2);
    --card-hover: rgba(68, 28, 73, 0.9);
    --text-primary: #fff1f2;
    --text-secondary: #fda4af;
    --accent-blue: #fb7185;
    --accent-purple: #f97316;
    --glow-1: rgba(244, 63, 94, 0.28);
    --glow-2: rgba(249, 115, 22, 0.22);
}

/* 4. Royal Violet */
[data-theme="violet"] {
    --bg-dark: #120926;
    --card-bg: rgba(33, 17, 71, 0.75);
    --card-border: rgba(168, 85, 247, 0.2);
    --card-hover: rgba(50, 26, 107, 0.9);
    --text-primary: #faf5ff;
    --text-secondary: #d8b4fe;
    --accent-blue: #c084fc;
    --accent-purple: #e879f9;
    --glow-1: rgba(168, 85, 247, 0.28);
    --glow-2: rgba(236, 72, 153, 0.22);
}

/* 5. Cyber Gold */
[data-theme="gold"] {
    --bg-dark: #17130e;
    --card-bg: rgba(38, 29, 18, 0.75);
    --card-border: rgba(245, 158, 11, 0.2);
    --card-hover: rgba(58, 44, 25, 0.9);
    --text-primary: #fffbeb;
    --text-secondary: #fcd34d;
    --accent-blue: #f59e0b;
    --accent-purple: #fbbf24;
    --glow-1: rgba(245, 158, 11, 0.28);
    --glow-2: rgba(217, 119, 6, 0.22);
}

/* 6. Clean Minimal Light */
[data-theme="light"] {
    --bg-dark: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.88);
    --card-border: rgba(15, 23, 42, 0.08);
    --card-hover: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-blue: #0284c7;
    --accent-purple: #7c3aed;
    --glow-1: rgba(56, 189, 248, 0.18);
    --glow-2: rgba(147, 197, 253, 0.25);
}
[data-theme="light"] .card-icon {
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
}
[data-theme="light"] .link-card {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .link-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .avatar {
    border: 3px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .auth-box, [data-theme="light"] .admin-box {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .form-input, [data-theme="light"] .form-textarea, [data-theme="light"] .form-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}
[data-theme="light"] .link-item-row {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* ==========================================================================
   Theme Selector Grid Styles
   ========================================================================== */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.theme-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid var(--card-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.theme-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(15, 23, 42, 0.85);
    transform: translateY(-2px);
}

.theme-card.active {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.theme-preview {
    display: flex;
    align-items: center;
    gap: 0;
}

.color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    margin-right: -6px;
    border: 2px solid rgba(15, 23, 42, 0.6);
}

.theme-info {
    flex: 1;
    min-width: 0;
}

.theme-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.theme-desc {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-active-badge {
    color: var(--accent-blue);
    font-size: 0.9rem;
}


/* ==========================================================================
   Community News & Feed Styles
   ========================================================================== */
.community-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.community-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.community-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.community-logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

.community-logo-text h2 {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.community-logo-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.community-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* Category Filter Bar */
.category-filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
    scrollbar-width: none;
}
.category-filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
    padding: 0.45rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-pill:hover, .filter-pill.active {
    color: var(--text-primary);
    background: var(--card-hover);
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* Post Creation Box */
.create-post-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.create-post-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-blue);
}

/* News Feed Cards */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.news-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.news-card:hover {
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.news-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.news-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--card-border);
}

.news-author-meta {
    display: flex;
    flex-direction: column;
}

.news-author-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.news-author-handle {
    font-family: var(--font-en);
    font-size: 0.8rem;
    color: var(--accent-blue);
    text-decoration: none;
    transition: all 0.2s;
}

.news-author-handle:hover {
    text-decoration: underline;
}

.news-timestamp {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.news-badge-cat {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.news-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.news-content {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.25rem;
    word-break: break-word;
}

/* Source Box */
.news-source-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.news-source-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 0;
}

.news-source-info i {
    color: var(--accent-blue);
}

.news-source-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-source-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    text-decoration: none;
    border: 1px solid rgba(56, 189, 248, 0.35);
    transition: all 0.2s ease;
}

.news-source-btn:hover {
    background: var(--accent-blue);
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
}


/* ==========================================================================
   News Ranking & Voting Styles
   ========================================================================== */
.category-banner {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14) 0%, rgba(168, 85, 247, 0.14) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-banner-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-banner-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.rank-1 {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.25), rgba(245, 158, 11, 0.25));
    color: #fde047;
    border: 1px solid rgba(250, 204, 21, 0.55);
}

.rank-2 {
    background: rgba(203, 213, 225, 0.18);
    color: #e2e8f0;
    border: 1px solid rgba(203, 213, 225, 0.45);
}

.rank-3 {
    background: rgba(217, 119, 6, 0.2);
    color: #fdba74;
    border: 1px solid rgba(217, 119, 6, 0.45);
}

.rank-other {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
}

.news-card.top-ranked {
    border-color: rgba(250, 204, 21, 0.45);
    box-shadow: 0 8px 30px rgba(250, 204, 21, 0.12);
}

.news-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.95rem;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    transition: all 0.2s ease;
    text-decoration: none;
}

.vote-btn:hover {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    transform: translateY(-1px);
}

.vote-btn.voted {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.25));
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.news-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-title-link:hover {
    color: var(--accent-blue);
}

.news-badge-cat {
    text-decoration: none;
    transition: all 0.2s ease;
}

.news-badge-cat:hover {
    background: var(--accent-blue);
    color: #0f172a;
}

/* ==========================================================================
   Community Directory & Story Ranking View (index.php & post.php)
   ========================================================================== */
.feed-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.feed-search-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1;
    min-width: 240px;
}

.feed-search-input-wrap {
    position: relative;
    flex: 1;
}

.feed-search-input-wrap i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.feed-search-input {
    padding-left: 2.3rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    font-size: 0.88rem !important;
}

.sort-toggle-group {
    display: inline-flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 25px;
    padding: 0.2rem;
    gap: 0.2rem;
}

.sort-pill {
    padding: 0.38rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.sort-pill:hover {
    color: var(--text-primary);
}

.sort-pill.active {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent-blue);
    font-weight: 600;
}

/* Directory Card Layout */
.news-directory-card {
    padding: 1.15rem 1.25rem;
}

.directory-card-layout {
    display: flex;
    align-items: stretch;
    gap: 1rem;
}

.directory-score-column {
    min-width: 64px;
    padding: 0.6rem 0.4rem;
    border-radius: 14px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--accent-blue);
    transition: all 0.2s ease;
    align-self: flex-start;
}

.directory-score-column:hover {
    background: rgba(56, 189, 248, 0.18);
    transform: translateY(-2px);
}

.directory-score-column i {
    font-size: 1.1rem;
    line-height: 1;
}

.directory-score-num {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.directory-score-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.directory-content-column {
    flex: 1;
    min-width: 0;
}

.directory-meta-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
}

.topic-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem;
    border-radius: 15px;
    font-size: 0.74rem;
    font-weight: 600;
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
    text-decoration: none;
    transition: all 0.2s ease;
}

.topic-badge:hover {
    background: var(--accent-purple);
    color: #fff;
}

.external-domain-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: 15px;
    font-size: 0.74rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    text-decoration: none;
    transition: all 0.2s ease;
}

.external-domain-pill:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.directory-title {
    font-size: 1.12rem;
    margin-bottom: 0.35rem;
}

.news-summary-clamp {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.directory-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--card-border);
}

.directory-author {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.directory-author-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
}

.directory-author-link:hover {
    color: var(--accent-blue);
}

.mini-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--card-border);
}

.related-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-blue);
    text-decoration: none;
    padding: 0.32rem 0.8rem;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    transition: all 0.2s ease;
}

.related-cta-link:hover {
    background: var(--accent-blue);
    color: #0f172a;
}

/* Story Detail & Ranking Page (post.php) */
.story-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.breadcrumb-link {
    color: var(--accent-blue);
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.selected-post-highlight {
    border-color: rgba(56, 189, 248, 0.45);
}

.selected-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem;
    border-radius: 15px;
    font-size: 0.74rem;
    font-weight: 600;
    background: rgba(56, 189, 248, 0.16);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.external-url-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 460px;
}

.vote-score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
}

.related-category-section {
    margin-bottom: 2rem;
}

.compact-news-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.compact-news-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.compact-news-item:hover {
    background: var(--card-hover);
    border-color: var(--accent-blue);
    transform: translateY(-1px);
}

.compact-score-box {
    min-width: 44px;
    padding: 0.35rem 0.4rem;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--accent-blue);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.15;
}

.compact-news-body {
    flex: 1;
    min-width: 0;
}

.compact-news-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.compact-news-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.topic-mini-tag {
    color: var(--accent-purple);
    font-weight: 600;
}

/* Light Theme Adjustments for Community Elements */
[data-theme="light"] .news-source-box {
    background: #f1f5f9;
    border-color: #e2e8f0;
}
[data-theme="light"] .external-domain-pill,
[data-theme="light"] .vote-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}
[data-theme="light"] .vote-score-pill {
    background: rgba(2, 132, 199, 0.15);
}

@media (max-width: 600px) {
    .directory-card-layout {
        flex-direction: column;
    }
    .directory-score-column {
        flex-direction: row;
        gap: 0.4rem;
        padding: 0.35rem 0.75rem;
        min-width: auto;
    }
    .external-url-preview {
        max-width: 220px;
    }
}
