:root {
    /* Base Variables (Dark Theme Default) */
    --bg: #0f1115;
    --surface: #1e212b;
    --surface2: #2a2e3b;
    --text: #ffffff;
    --text-muted: #9ca3af;

    /* Brand Colors - Adaptive Monochrome */

    /* 1. BUTTONS (Backgrounds) */
    /* Dark Theme: Soft Dark Gray */
    --btn-bg: #334155;
    --btn-bg-hover: #475569;
    --btn-text: #ffffff;

    /* 2. ICONS & LINKS (Text) */
    /* Dark Theme: Bright Silver to pop on dark bg */
    --primary: #cbd5e1;
    --primary-hover: #ffffff;

    --secondary: #94a3b8;
    --accent: #38bdf8;

    /* Status Colors */
    --error: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;

    --fab-grad-start: #334155;
    --fab-grad-end: #1e293b;

    /* Functional */
    --border: rgba(255, 255, 255, 0.08);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: cubic-bezier(0.4, 0, 0.2, 1) 0.3s;

    /* Glass Morphism (Simplified to Solid/Semi-Transparent) */
    --glass-bg: var(--surface);
    --glass-border: var(--border);
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --backdrop: none;

    /* Gradients */
    --gradient-glow: none;
    --gradient-primary: linear-gradient(135deg, var(--btn-bg) 0%, var(--btn-bg-hover) 100%);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg: #e2e8f0;
    /* Deeper gray for the background */
    --surface: #f8fafc;
    /* Bright, but not pure white, light gray for cards */
    --surface2: #f1f5f9;
    /* Mid-light gray for inputs/secondary areas */
    --text: #1e293b;
    /* Very dark slate, guarantees high contrast readability */
    --text-muted: #475569;
    --border: rgba(15, 23, 42, 0.1);

    /* 1. BUTTONS (Backgrounds) */
    --btn-bg: #e2e8f0;
    --btn-bg-hover: #cbd5e1;
    --btn-text: #0f172a;

    /* 2. ICONS & LINKS (Text) */
    --primary: #334155;
    --primary-hover: #0f172a;

    --secondary: #64748b;
    --accent: #0ea5e9;

    /* Status Colors */
    --error: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;

    --fab-grad-start: #f8fafc;
    --fab-grad-end: #f1f5f9;

    /* Glass Morphism */
    --glass-bg: rgba(248, 250, 252, 0.95);
    /* Header/Nav match the bright cards, distinctly popping off background */
    --glass-border: rgba(248, 250, 252, 0.6);
    --glass-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --backdrop: blur(12px);

    --gradient-glow: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    margin-bottom: 0.5em;
    color: var(--text);
    /* Fixed from #fff to var(--text) for theme adapt */
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

/* Glass Panel - The Core Component */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
}

/* Navigation */
nav {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    transition: all 0.3s ease;
}

main.container {
    margin-top: 25px;
    /* Global spacing after top bar */
}

.container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Material Buttons */
.btn {
    padding: 10px 24px;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

/* Ripple Effect Setup (Optional via JS, but simulated via CSS active) */
.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    /* Adaptive text color */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--btn-bg-hover);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.btn-accent {
    background: var(--accent);
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.btn-accent:hover {
    background: #0284c7;
    /* darker shade for hover */
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.3);
    transform: translateY(-2px);
}

.btn-link {
    background: none;
    color: var(--text-muted);
    padding: 0;
}

.btn-link:hover {
    color: var(--text);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

/* Extra Small Button (Global) */
.btn-xs {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

/* Outline Button (Global) */
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* Inputs - Material Style */
input,
textarea,
select {
    background: var(--surface2);
    border: 2px solid transparent;
    /* Prepare for focus border */
    color: var(--text);
    padding: 14px 16px;
    border-radius: var(--radius);

    [data-theme="light"] input,
    [data-theme="light"] textarea,
    [data-theme="light"] select {
        border: 1px solid var(--border);
        background: #ffffff;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    width: 100%;
    outline: none;
    transition: var(--transition);
    font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 24px;
}

/* Cards */
.card,
.post-card-container {
    /* Assuming post-card-container is used, or generic card */
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px solid transparent;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Search Bar */
.search-bar {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 10px 20px;
    padding-left: 45px !important;
    border-radius: 50px;
    color: var(--text);
    width: 280px;
    transition: var(--transition);
}

.search-bar:focus {
    width: 320px;
    border-color: var(--primary);
    background: var(--surface);
}

/* Navigation Icons */
.nav-icon {
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

/* Notifications */
.notification-wrapper {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--bg);
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

.notification-dropdown {
    position: absolute;
    top: 120%;
    right: -10px;
    width: 360px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    margin-top: 10px;
    animation: fadeIn 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

.notification-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface2);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-list .notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    gap: 15px;
    transition: background 0.2s ease;
}

.notification-list .notification-item:hover {
    background: var(--surface2);
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    line-height: 40px;
    text-align: center;
    background-color: var(--accent);
    font-size: 1.2rem;
    font-weight: 600;
}

.notification-content {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-time {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Delete Button Styling */
.notification-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 5px;
    /* Alignment fix */
    font-size: 1.2rem;
    opacity: 0;
    /* Hidden by default on desktop until hover */
}

.notification-item:hover .notification-delete-btn {
    opacity: 1;
}

.notification-delete-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile */
/* Mobile Only Utility (Global) */
.mobile-only {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {

    /* Hide top nav items */
    .nav-links,
    .user-menu,
    .desktop-only {
        display: none !important;
    }

    /* Show Mobile Elements */
    .mobile-only {
        display: flex !important;
    }

    /* Adjust Layout */
    .brand {
        font-size: 1.3rem;
        margin: 0;
        /* Reset auto margin */
    }

    nav .container {
        justify-content: space-between;
        /* Space out brand and toggle */
    }

    .search-bar {
        display: none;
        /* Hide top search bar on mobile, use bottom nav tab */
    }

    /* Stack Grids */
    .stats-grid,
    .content-grid,
    .employer-grid {
        grid-template-columns: 1fr !important;
    }

    /* Mobile Dashboard Icons (Profile) */
    .mobile-dashboard-icons {
        gap: 15px;
        justify-content: center;
        margin-top: 20px !important;
        width: 100%;
        flex-wrap: wrap;
    }

    .btn-icon {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--surface);
        border: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: var(--text-muted);
        transition: var(--transition);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }

    .btn-icon:hover {
        color: var(--primary);
        transform: translateY(-2px);
        border-color: var(--primary);
    }

    /* Prevent full width on these icons if generic btn rules apply */
    .profile-header .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .profile-header>div:last-child {
        flex-direction: column;
    }

    /* Body Padding for Bottom Nav */
    body {
        padding-bottom: 90px;
    }

    /* Profile Mobile Adjustments */
    .profile-header {
        margin-top: 20px !important;
        padding: 30px 20px !important;
    }

    .profile-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px !important;
    }

    .profile-actions .btn {
        width: 100%;
    }
}

/* Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    top: auto;
    /* Override global nav style */
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0;
    /* Override global nav padding */
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }

    /* Mobile Notification Panel */
    #mobile-notifications-panel {
        position: fixed;
        bottom: 70px;
        /* Above nav */
        left: 0;
        width: 100%;
        max-height: 80vh;
        background: var(--surface);
        border-top: 1px solid var(--border);
        border-radius: 20px 20px 0 0;
        z-index: 2000;
        display: none;
        /* Toggled via JS */
        flex-direction: column;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
        animation: slideUp 0.3s cubic-bezier(0.2, 0, 0.2, 1);
    }

    #mobile-notifications-panel .panel-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--surface2);
        border-radius: 20px 20px 0 0;
    }

    #mobile-notif-close {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.1);
    }

    #mobile-notif-close:hover {
        background: rgba(239, 68, 68, 0.2);
    }

    #mobile-notifications-panel .notification-list {
        overflow-y: auto;
        padding: 0;
        max-height: calc(80vh - 60px);
    }

    /* Better styling for read all button (Moved to global) */
    /* .btn-xs and .btn-outline are now global */

    /* Delete Button Styling */
    .notification-delete-btn {
        background: transparent;
        border: none;
        color: var(--text-muted);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: var(--transition);
        margin-top: 5px;
        /* Alignment fix */
        font-size: 1.2rem;
    }

    .notification-delete-btn:hover {
        background: #fee2e2;
        color: #ef4444;
    }

    /* Responsive Item Styling */
    .notification-list .notification-item {
        padding: 15px 20px;
        border-bottom: 1px solid var(--border);
        gap: 15px;
    }

    .notification-content {
        flex: 1;
        min-width: 0;
        /* Enable truncation inside flex */
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .notification-time {
        display: block;
        margin-top: 4px;
        font-size: 0.75rem;
        color: var(--text-muted);
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    gap: 4px;
    width: 20%;
    height: 100%;
}

.nav-item i {
    font-size: 1.5rem;
    transition: var(--transition);
}

.nav-item:hover i,
.nav-item:active i {
    transform: scale(1.2);
    /* Zoom effect */
    color: var(--primary);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-2px);
}

.nav-item.highlight {
    position: relative;
    top: -20px;
}

.fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: var(--primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: var(--transition);
    border: 4px solid var(--bg);
    /* Create gap effect */
}

.fab i {
    font-size: 1.8rem;
}

.fab:hover,
.fab:active {
    transform: scale(1.1);
}

/* Rich Text Content */
.rich-text h1,
.rich-text h2,
.rich-text h3 {
    margin-top: 0.5em;
    margin-bottom: 0.3em;
    line-height: 1.2;
}

.rich-text p {
    margin-bottom: 0.8em;
    line-height: 1.6;
    color: var(--text);
    opacity: 0.9;
}

.rich-text ul,
.rich-text ol {
    margin-left: 1.5em;
    margin-bottom: 0.8em;
}

.rich-text a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.rich-text blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    color: var(--text-muted);
    font-style: italic;
    background: var(--surface2);
    padding: 16px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 1em;
}

.rich-text pre {
    background: #0f1115;
    /* Always dark for code */
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1em;
    color: #e2e8f0;
}

/* Profile Styles - Restored Card Design */
.profile-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 50px 40px;
    background: var(--surface2);
    /* Fallback */
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    /* margin-top: 40px; Removed in favor of global main spacing */
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

.profile-avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--surface);
    box-shadow: 0 0 0 2px var(--accent);
    /* Double border effect */
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.profile-stats {
    margin-top: 25px;
    display: inline-flex;
    justify-content: center;
    gap: 0;
    background: var(--surface);
    border-radius: 16px;
    padding: 10px 20px;
    border: 1px solid var(--border);
}

.profile-stats>div {
    padding: 0 25px;
    text-align: center;
    line-height: 1.3;
    transition: var(--transition);
}

.profile-stats>div:first-child {
    border-right: 1px solid var(--border);
}

.profile-stats>div:hover {
    color: var(--primary);
}

.profile-actions {
    margin-top: 35px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.profile-actions .btn {
    min-width: 120px;
    justify-content: center;
}

/* Specific button styles for profile to ensure consistency */
.profile-actions form {
    margin: 0;
}

/* Application List Styles */
.application-card {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: var(--transition);
}

.application-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.application-info {
    flex: 1;
    min-width: 0;
    /* Truncation helper */
}

.application-info h3 {
    margin: 0;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.application-info .meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.application-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-buttons form {
    margin: 0;
}

.text-error {
    color: var(--error) !important;
}

.border-error {
    border-color: var(--error) !important;
}

/* Responsive Applications */
@media (max-width: 768px) {
    .application-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .application-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 15px;
        border-top: 1px solid var(--border);
        padding-top: 15px;
    }

    .action-buttons {
        width: 100%;
        gap: 10px;
        justify-content: flex-end;
        /* Align buttons to right on mobile */
    }

    .action-buttons .btn {
        flex: 1;
        /* Stretch buttons on very small screens? optional */
        justify-content: center;
    }
}

/* Applicants Grid (Employer) */
.applicants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.applicant-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    background: var(--glass-bg);
    /* Ensure background is set if glass-panel class is missing or weak */
}

.applicant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.applicant-info-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    /* Enable flex truncate */
}

.applicant-avatar,
.applicant-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.applicant-avatar-placeholder {
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 700;
}

.applicant-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Enable flex truncate */
}

.applicant-name {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.applicant-email {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.applicant-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.applicant-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    gap: 10px;
}

.applicant-row .label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.applicant-row .value {
    color: var(--text);
    text-align: right;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    /* Critical for flex truncation */
}

.applicant-row .value.link {
    color: var(--accent);
}

.applicant-cover-letter {
    background: var(--surface2);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 5px;
}

.text-truncated {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    color: var(--text-muted);
    display: block;
}

.applicant-footer {
    margin-top: auto;
}

.width-full {
    width: 100%;
}

/* Analytics Styles */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.analytics-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.post-title {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    font-size: 1.05rem;
    display: block;
    margin-bottom: 4px;
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.analytics-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.text-primary {
    color: var(--primary);
}

@media (max-width: 500px) {
    .analytics-stats {
        grid-template-columns: repeat(2, 1fr);
        /* 2x2 grid on mobile */
        gap: 20px;
    }
}

/* Post Card & Feed Styles */
.post-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Adds padding between texts/sections */
    color: var(--text);
    transition: var(--transition);
    margin-bottom: 24px;
    /* Default margin for standard feed */
}

.post-card:hover {
    box-shadow: var(--glass-shadow);
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
}

.feed-header {
    margin-bottom: 30px;
    /* Space between header text and cards */
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.feed-grid .post-card {
    margin-bottom: 0;
    /* Remove bottom margin in grid */
    height: 100%;
    /* Equal height cards */
}

@media (max-width: 600px) {
    .feed-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Post Card Internals */
.post-header {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    position: relative;
}

.company-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Make it round */
    background: var(--surface);
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

.post-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-muted);
    font-size: 1.2rem;
    background: var(--surface2);
}

.post-meta {
    flex: 1;
    min-width: 0;
    /* Fix flexbox truncation issue */
}

/* Mobile Tweaks */
@media (max-width: 480px) {
    .post-card {
        padding: 16px;
        /* Slightly tighter padding */
        gap: 12px;
    }

    .post-title a {
        font-size: 1.1rem;
        /* readable title */
    }

    .post-actions {
        flex-wrap: wrap;
        /* Allow buttons to wrap */
        gap: 10px;
    }

    .post-actions .action-btn {
        flex: 1;
        /* uniform button width on mobile row */
        justify-content: center;
    }
}

/* --- New Post Header Design --- */
.header-main-row {
    display: flex;
    gap: 16px;
    width: 100%;
    align-items: flex-start;
}

.company-logo-wrapper {
    flex-shrink: 0;
}

.company-logo-wrapper .logo-link {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    /* Soft square looks better for companies */
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.company-logo-wrapper .logo-link:hover {
    transform: scale(1.05);
}

.post-avatar,
.post-avatar-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-avatar-placeholder {
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
}

.post-header-content {
    flex: 1;
    min-width: 0;
    /* Enable flex text truncation */
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Top Row: User • Time */
.header-top-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.publisher-name {
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}

.meta-separator {
    opacity: 0.5;
}

.post-time {
    font-size: 0.8rem;
}

.closing-badge {
    margin-left: auto;
    /* Push to right */
    color: #ef4444;
    font-size: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Middle: Title */
.post-title {
    margin: 2px 0;
    line-height: 1.3;
}

.post-title a {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Max 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bottom: Company • Location • Follow */
/* Bottom: Company • Location • Follow */
.header-sub-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    width: 100%;
    /* Ensure it takes full width for flex alignment */
}

.company-name {
    font-weight: 600;
    color: var(--text);
}

.btn-follow-text {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 14px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: initial;
    /* Remove auto margin to keep it inline with text */
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 24px;
    /* Fixed height for consistency */
}

.btn-follow-text:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
    transform: translateY(-1px);
}

.btn-follow-text.following {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
    box-shadow: none;
}

.btn-follow-text.following:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .header-main-row {
        gap: 12px;
    }

    .company-logo-wrapper .logo-link {
        width: 42px;
        height: 42px;
    }

    .post-title a {
        font-size: 1.1rem;
    }

    .header-sub-meta {
        font-size: 0.85rem;
    }
}

/* Enhanced Content Layout */
/* The .post-title a rule above replaces the one here */
/* The .company-name rule above replaces the one here */
.post-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.post-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    /* Push to bottom if flex column */
}

/* Pill Variations */
.pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.pill-work {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.pill-job {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.pill-salary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}

/* --- New Post Footer Design --- */
.post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    flex-wrap: wrap;
}

.actions-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    /* Push to right */
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    /* Slightly larger icons */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
}

.action-btn span {
    font-size: 0.85rem;
    font-weight: 500;
}

.action-btn:hover {
    background: var(--surface2);
    color: var(--text);
}

/* Specific Action Colors on Hover/Active */
.like-btn.liked,
.like-btn:hover {
    color: #f65a8f;
}

.like-btn.liked i {
    color: #f65a8f;
}

.comment-btn:hover {
    color: var(--accent);
}

.share-btn:hover {
    color: var(--success);
    /* Green for share? Or just text color */
}

.save-btn.active,
.save-btn:hover {
    color: #ef4444;
}

/* Owner Actions */
.owner-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.apply-btn i {
    font-size: 1rem;
}

.owner-btn {
    font-size: 0.9rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 12px;
}

/* Mobile Footer Tweaks */
@media (max-width: 480px) {
    .post-actions {
        gap: 12px;
    }

    .actions-left {
        gap: 8px;
        flex: 1;
        /* Take up space */
        justify-content: space-between;
        /* Spread icons if tight, or keep left? */
    }

    .actions-right {
        margin-left: 0;
        width: 100%;
        /* Full width button on mobile? Or just auto */
        justify-content: flex-end;
    }

    .apply-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Card Description Preview */
.description-preview {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.description-preview img,
.description-preview video,
.description-preview iframe,
.description-preview figure {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 10px 0;
}

.description-preview table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
}

.description-preview th,
.description-preview td {
    border: 1px solid var(--border);
    padding: 8px;
}

.description-preview.is-long {
    max-height: 160px;
    overflow: hidden;
    position: relative;
}

.description-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(transparent, var(--glass-bg));
    pointer-events: none;
}

.read-more-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 5px;
    margin-bottom: 5px;
    padding: 4px 0;
    /* Increased touch target for mobile */
}

@media (max-width: 768px) {
    .description-preview {
        font-size: 0.85rem;
    }

    .description-preview p,
    .description-preview ul,
    .description-preview ol {
        margin-bottom: 0.5em;
    }

    .description-preview.is-long {
        max-height: 100px;
        /* Shorter on mobile */
    }

    .description-fade {
        height: 40px;
    }
}

/* Brand Logo Styles */
.brand {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s ease, filter 0.3s ease;
}

@media (max-width: 768px) {
    .brand {
        margin-left: 15px;
    }
}

.brand:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.brand-icon {
    font-size: 1.8rem;
    color: var(--accent);
    /* Fallback or gradient start */
    -webkit-text-fill-color: initial;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.1);
}

[data-theme="light"] .brand {
    background: linear-gradient(135deg, #0284c7 0%, #6d28d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-icon {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.1);
}

.universal-refresh-btn {
    position: fixed;
    bottom: 90px;
    /* Above mobile bottom nav */
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.3s ease,
        background 0.2s ease,
        opacity 0.2s ease;
}

.universal-refresh-btn:hover {
    transform: scale(1.05) rotate(90deg);
}

.universal-refresh-btn:active {
    transform: scale(0.95);
}

@media (min-width: 769px) {
    .universal-refresh-btn {
        bottom: 30px;
        /* Lower on desktop since no bottom nav */
        right: 30px;
    }
}