/* ==========================================================================
   1. COLOR VARIABLES & THEME DEFINITIONS
   ========================================================================== */
:root {
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --border-color: oklch(89% 0.015 250);
    --text-main: oklch(18% 0.03 255);
    --text-muted: oklch(45% 0.03 255);
    --primary-color: oklch(50% 0.22 260);
    --primary-hover: oklch(42% 0.22 260);
    --input-bg: oklch(98.5% 0.005 245);
    --comment-bg: oklch(97.2% 0.006 245);
    --avatar-bg: oklch(94% 0.04 250);
    --avatar-text: oklch(42% 0.20 260);
    --kebab-hover: oklch(92% 0.015 250);
    --color-gold: oklch(68% 0.16 75);
    --color-emerald: oklch(52% 0.17 155);
    --color-crimson: oklch(52% 0.22 25);

    /* Motion Tokens */
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
    --dur-fast: 160ms;
    --dur-norm: 260ms;
    --dur-slow: 420ms;
}

/* Button & Card Micro-Interactions */
button, .timeline-card, .filter-chip, .action-btn {
    transition: transform var(--dur-fast) var(--ease-out-quint),
                box-shadow var(--dur-fast) var(--ease-out-quint),
                background-color var(--dur-fast) ease,
                border-color var(--dur-fast) ease,
                color var(--dur-fast) ease !important;
    will-change: transform;
}

button:hover:not(:disabled),
.filter-chip:hover {
    transform: translateY(-1.5px) scale(1.015);
}

button:active:not(:disabled),
.filter-chip:active {
    transform: translateY(0.5px) scale(0.975);
}

.timeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}


body.dark-mode,
body.dark-theme,
.dark-theme {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --input-bg: #0f172a;
    --comment-bg: #0f172a;
    --avatar-bg: #1e3a8a;
    --avatar-text: #93c5fd;
    --kebab-hover: #334155;
}

/* ==========================================================================
   2. GLOBAL LAYOUT & CONTAINER FIXES
   ========================================================================== */
* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
    min-height: -webkit-fill-available;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
    width: 100% !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
}

.main-wrapper {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 16px 20px 80px !important;
    box-sizing: border-box !important;
    background-color: #ffffff !important;
}

body.dark-theme .main-wrapper,
body.dark-mode .main-wrapper {
    background-color: #0f172a !important;
}

/* Post Message Textarea Auto-Expand & Hide Scrollbars */
#postMessage,
.comment-input-field,
.auto-expand-textarea {
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    resize: none !important;
    transition: height 0.1s ease !important;
}

#postMessage::-webkit-scrollbar,
.comment-input-field::-webkit-scrollbar,
.auto-expand-textarea::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

input, textarea, button, select {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 14.5px;
}

.page-wrapper {
    background-color: var(--bg-color) !important;
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Fixes the white background issue by explicitly using --bg-color */
.container,
.timeline-container,
#timelineApp { 
    max-width: 680px !important; 
    margin: 0 auto !important; 
    background-color: transparent !important;
    background: transparent !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: left !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

#timelineFeed {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: left !important;
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

body.dark-theme #timelineFeed,
body.dark-mode #timelineFeed {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.timeline-feed-header {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-bottom: none !important;
    margin-bottom: 16px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
}

.timeline-heading {
    text-align: center !important;
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
}

/* Timeline Post Image Attachment Styling */
.post-image-container {
    width: 100% !important;
    margin: 10px 0 12px 0 !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow: hidden !important;
}

.post-attached-image {
    max-width: 100% !important;
    max-height: 440px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    border: 1px solid var(--border-color, #cbd5e1) !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    display: block !important;
    background: var(--input-bg, #f8fafc) !important;
}

.post-attached-image:hover {
    transform: scale(1.01) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

.composer-image-preview-container {
    margin: 4px 0 14px 0 !important;
    padding: 10px 14px !important;
    background: var(--input-bg, #f8fafc) !important;
    border: 1.5px dashed var(--border-color, #cbd5e1) !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
}

.composer-preview-img-wrapper {
    position: relative !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    border: 1px solid var(--border-color) !important;
    background: #000 !important;
}

.composer-preview-img-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.composer-remove-img-btn {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
}

.composer-image-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    overflow: hidden !important;
    flex: 1 !important;
}

.composer-image-name {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.composer-image-status {
    font-size: 12px !important;
    font-weight: 700 !important;
}

.composer-action-tools {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    flex: 1 !important;
}

.btn-composer-tool {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    color: var(--text-muted, #64748b) !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: all 0.15s ease !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    width: auto !important;
    min-width: fit-content !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.btn-composer-tool:hover {
    background: rgba(37, 99, 235, 0.08) !important;
    color: var(--primary-color, #2563eb) !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-composer-tool svg {
    color: var(--primary-color, #2563eb) !important;
    stroke: var(--primary-color, #2563eb) !important;
}

.btn-composer-tool.icon-only {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    border-radius: 50% !important;
}

.btn-composer-tool svg {
    flex-shrink: 0 !important;
}

.admin-only-view.hidden {
    display: none !important;
}

.timeline-user-subtext {
    font-size: 13px;
    color: var(--primary-blue, #1e5eff) !important;
    margin: 2px 0 0 0;
    font-weight: 600;
}

body.dark-theme .timeline-user-subtext,
body.dark-mode .timeline-user-subtext {
    color: #60a5fa !important;
}

/* Hide student-only navigation tabs for Staff/Teacher/Admin accounts */
.student-only-nav.hidden,
.kebab-item.student-only-nav.hidden,
.menu-btn.student-only-nav.hidden {
    display: none !important;
}

/* Bulletproof reinforcement for Mobile Menu Button */
#mobileTopbarKebabBtn.mobile-kebab-btn,
.mobile-kebab-container .mobile-kebab-btn {
    background: #1e5eff !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    border-radius: 10px !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 3px 10px rgba(30, 94, 255, 0.45) !important;
    padding: 0 !important;
    cursor: pointer !important;
}

#mobileTopbarKebabBtn.mobile-kebab-btn svg,
.mobile-kebab-container .mobile-kebab-btn svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #ffffff !important;
    fill: none !important;
    stroke-width: 2.2 !important;
    color: #ffffff !important;
    pointer-events: none !important;
    display: block !important;
}

body.dark-theme #mobileTopbarKebabBtn.mobile-kebab-btn,
body.dark-mode #mobileTopbarKebabBtn.mobile-kebab-btn {
    background: #2563eb !important;
    border: 1px solid rgba(147, 197, 253, 0.6) !important;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.6) !important;
}

/* ==========================================================================
   3. POST CREATION AREA
   ========================================================================== */
.post-box { 
    background: var(--card-bg, #ffffff) !important; 
    padding: 20px 22px !important; 
    border-radius: 16px !important; 
    margin-bottom: 20px !important; 
    border: 1px solid var(--border-color, #e2e8f0) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

body.dark-theme .post-box,
body.dark-mode .post-box {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.composer-author-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
}

.composer-avatar-circle {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: #1e5eff !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
}

.composer-input-wrapper {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.post-box textarea,
#postMessage { 
    width: 100% !important; 
    padding: 12px 14px !important; 
    margin: 4px 0 10px 0 !important; 
    background-color: var(--input-bg, #f8fafc) !important;
    color: var(--text-main) !important;
    border: 1.5px solid var(--border-color, #cbd5e1) !important; 
    border-radius: 12px !important; 
    font-size: 15px !important;
    line-height: 1.5 !important;
    resize: none !important; 
    min-height: 85px !important; 
    outline: none !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.post-box textarea:focus,
#postMessage:focus {
    background-color: var(--card-bg, #ffffff) !important;
    border-color: var(--primary-color, #2563eb) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.post-options-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 6px !important;
    padding-top: 10px !important;
    border-top: 1px solid var(--border-color, #e2e8f0) !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.composer-action-tools {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.btn-composer-tool,
#btnAttachImage,
#btnTogglePollComposer {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    color: var(--text-muted, #64748b) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: all 0.15s ease !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    width: auto !important;
    min-width: fit-content !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.btn-composer-tool:hover,
#btnAttachImage:hover,
#btnTogglePollComposer:hover {
    background: rgba(37, 99, 235, 0.08) !important;
    color: var(--primary-color, #2563eb) !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-composer-tool svg {
    width: 17px !important;
    height: 17px !important;
    color: var(--primary-color, #2563eb) !important;
    stroke: var(--primary-color, #2563eb) !important;
    flex-shrink: 0 !important;
}

.target-selector-wrapper {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
}

.target-selector-wrapper select,
#postTargetClass {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 11px center !important;
    background-size: 11px 11px !important;
    padding: 0 32px 0 14px !important;
    border-radius: 20px !important;
    border: 1.5px solid var(--border-color, #cbd5e1) !important;
    background-color: var(--input-bg, #f8fafc) !important;
    color: var(--text-main, #0f172a) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    width: auto !important;
    min-width: 115px !important;
    max-width: none !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    outline: none !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    transition: all 0.2s ease !important;
}

.target-selector-wrapper select:hover,
#postTargetClass:hover {
    border-color: var(--primary-color, #2563eb) !important;
    color: var(--primary-color, #2563eb) !important;
    background-color: var(--card-bg, #ffffff) !important;
}

#submitPostBtn { 
    background: transparent !important; 
    color: var(--primary-color, #1e5eff) !important; 
    border: none !important; 
    box-shadow: none !important;
    padding: 6px 14px !important; 
    border-radius: 8px !important; 
    cursor: pointer !important; 
    font-weight: 700 !important; 
    font-size: 14.5px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    width: auto !important; 
    min-width: fit-content !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#submitPostBtn:hover {
    background: rgba(30, 94, 255, 0.08) !important;
    color: var(--primary-hover, #113f9f) !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* --- MULTI-PHOTO COMPOSER STRIP --- */
.composer-images-strip {
    display: flex;
    gap: 10px;
    padding: 10px 0 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    width: 100%;
    box-sizing: border-box;
}

.composer-images-strip::-webkit-scrollbar {
    height: 5px;
}

.composer-images-strip::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.composer-image-chip {
    position: relative;
    width: 86px;
    height: 86px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid var(--border-color, #e2e8f0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #0f172a10;
}

.composer-image-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.composer-image-chip .chip-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: none;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, transform 0.15s ease;
}

.composer-image-chip .chip-remove-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.composer-image-chip .chip-uploading-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.82);
    color: #38bdf8;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    padding: 2px 4px;
}

/* --- POLL COMPOSER BOX --- */
.composer-poll-box {
    background: rgba(37, 99, 235, 0.04);
    border: 1.5px dashed rgba(37, 99, 235, 0.35);
    border-radius: 14px;
    padding: 14px 16px;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.dark-theme .composer-poll-box,
body.dark-mode .composer-poll-box {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(96, 165, 250, 0.35);
}

.composer-poll-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.composer-poll-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary-color, #2563eb);
    display: flex;
    align-items: center;
    gap: 6px;
}

.composer-poll-discard-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
}

.composer-poll-discard-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.poll-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.poll-option-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--card-bg, #ffffff);
    color: var(--text-main);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s ease;
}

.poll-option-input:focus {
    border-color: var(--primary-color, #2563eb);
}

.poll-remove-opt-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.poll-remove-opt-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.poll-add-opt-btn {
    align-self: flex-start;
    background: transparent;
    border: 1px dashed var(--primary-color, #2563eb);
    color: var(--primary-color, #2563eb);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.poll-add-opt-btn:hover {
    background: rgba(37, 99, 235, 0.08);
}

/* --- MULTI-PHOTO FEED GRIDS (1 to 5 PHOTOS) --- */
.timeline-photo-grid {
    display: grid;
    gap: 6px;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.timeline-photo-grid .photo-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #0f172a15;
    border-radius: 8px;
}

.timeline-photo-grid .photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.timeline-photo-grid .photo-item:hover img {
    transform: scale(1.025);
}

/* 1 Photo */
.timeline-photo-grid.grid-1 {
    grid-template-columns: 1fr;
    max-height: 480px;
}
.timeline-photo-grid.grid-1 .photo-item {
    max-height: 480px;
}

/* 2 Photos: 2 columns side-by-side */
.timeline-photo-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
    aspect-ratio: 16 / 9;
    max-height: 380px;
}

/* 3 Photos: 1 big left, 2 stacked right */
.timeline-photo-grid.grid-3 {
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 16 / 10;
    max-height: 400px;
}
.timeline-photo-grid.grid-3 .photo-item:nth-child(1) {
    grid-row: span 2;
}

/* 4 Photos: 2x2 symmetrical grid */
.timeline-photo-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 1 / 1;
    max-height: 420px;
}

/* 5 Photos: Top row 2 items (span 3 cols each), Bottom row 3 items (span 2 cols each) */
.timeline-photo-grid.grid-5 {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 1.3fr 1fr;
    aspect-ratio: 16 / 11;
    max-height: 440px;
}
.timeline-photo-grid.grid-5 .photo-item:nth-child(1),
.timeline-photo-grid.grid-5 .photo-item:nth-child(2) {
    grid-column: span 3;
}
.timeline-photo-grid.grid-5 .photo-item:nth-child(3),
.timeline-photo-grid.grid-5 .photo-item:nth-child(4),
.timeline-photo-grid.grid-5 .photo-item:nth-child(5) {
    grid-column: span 2;
}

/* --- FEED POLL COMPONENT --- */
.timeline-poll-card {
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.dark-theme .timeline-poll-card,
body.dark-mode .timeline-poll-card {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

.poll-question {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main);
}

.poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.poll-option-button {
    position: relative;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color, #e2e8f0);
    background: var(--card-bg, #ffffff);
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.poll-option-button:hover:not(.voted-state) {
    border-color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.04);
}

body.dark-theme .poll-option-button,
body.dark-mode .poll-option-button {
    background: #1e293b;
    border-color: #334155;
}

.poll-option-button.voted-state {
    cursor: default;
    background: rgba(15, 23, 42, 0.03);
}

body.dark-theme .poll-option-button.voted-state,
body.dark-mode .poll-option-button.voted-state {
    background: rgba(255, 255, 255, 0.04);
}

.poll-option-button.my-vote {
    border-color: #10b981 !important;
    font-weight: 700;
}

.poll-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.14);
    border-radius: 8px;
    transition: width 0.4s var(--ease-out-quint, ease-out);
    z-index: 0;
    pointer-events: none;
}

.poll-option-button.my-vote .poll-progress-fill {
    background: rgba(16, 185, 129, 0.18);
}

.poll-option-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.poll-meta-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    padding-top: 4px;
}

/* --- POST ACTIONS BAR (LIKE & COMMENT COMPACT & CLOSER) --- */
.post-actions-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin-top: 6px !important;
    padding-top: 2px !important;
    border-top: none !important;
    width: 100% !important;
}

body.dark-theme .post-actions-bar,
body.dark-mode .post-actions-bar {
    border-top: none !important;
}

.post-actions-bar .action-btn,
.post-actions-bar button,
.action-btn.like-btn,
.action-btn.comment-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 2px 7px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    height: 26px !important;
    min-height: 26px !important;
    width: auto !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    transition: all 0.15s ease !important;
}

.post-actions-bar .action-icon,
.action-icon.heart-icon {
    width: 14.5px !important;
    height: 14.5px !important;
    flex-shrink: 0 !important;
}

.post-actions-bar .action-btn:hover,
.post-actions-bar button:hover,
.action-btn.like-btn:hover,
.action-btn.comment-btn:hover {
    background: rgba(15, 23, 42, 0.05) !important;
    color: var(--text-main) !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

body.dark-theme .post-actions-bar .action-btn:hover,
body.dark-mode .post-actions-bar .action-btn:hover,
body.dark-theme .action-btn.like-btn:hover,
body.dark-mode .action-btn.like-btn:hover,
body.dark-theme .action-btn.comment-btn:hover,
body.dark-mode .action-btn.comment-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.action-btn.like-btn:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.action-btn.like-btn.liked {
    color: #ef4444 !important;
}

.action-btn.like-btn.liked svg {
    fill: #ef4444 !important;
    stroke: #ef4444 !important;
    animation: heartPulse 0.35s ease-out;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.32); }
    100% { transform: scale(1); }
}

.action-btn.comment-btn:hover {
    color: var(--primary-color, #2563eb) !important;
    background: rgba(37, 99, 235, 0.08) !important;
}

/* ==========================================================================
   4. TIMELINE POSTS (TWITTER / THREADS DIVIDER STYLE - VISIBLE DIVIDERS)
   ========================================================================== */
.timeline-post { 
    background: transparent !important; 
    padding: 18px 20px !important; 
    border-radius: 0 !important; 
    margin-bottom: 0 !important; 
    border: none !important; 
    border-bottom: 1px solid rgba(0, 0, 0, 0.09) !important; 
    box-shadow: none !important; 
    transition: background-color 0.15s ease !important;
    box-sizing: border-box !important;
}

.timeline-post:last-child {
    border-bottom: none !important;
}

body.dark-theme .timeline-post,
body.dark-mode .timeline-post {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
}

body.dark-theme .timeline-post:last-child,
body.dark-mode .timeline-post:last-child {
    border-bottom: none !important;
}

.timeline-post:hover {
    background-color: rgba(0, 0, 0, 0.015) !important;
}

body.dark-theme .timeline-post:hover,
body.dark-mode .timeline-post:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.post-header,
.post-sender-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-bottom: 12px !important;
    position: relative !important;
}

.sender-info-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--avatar-bg);
    color: var(--avatar-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.avatar-circle-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-transform: uppercase;
}

.avatar-circle.comment-avatar {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    font-size: 14px !important;
}

.sender-details {
    display: flex;
    flex-direction: column;
}

.sender-name-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sender-name {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
}

.post-time {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.staff-badge { 
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    background: #10b981; 
    color: white; 
    width: 18px;
    height: 18px;
    border-radius: 50%; 
    font-size: 11px; 
    font-weight: 700;
    line-height: 1;
}

.post-body { 
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 14.5px !important;
    font-weight: 400 !important;
    color: var(--text-main) !important; 
    margin: 4px 0 10px 0 !important;
    white-space: pre-wrap !important; 
    line-height: 1.55 !important;
    padding-left: 0 !important;
    padding: 0 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* ==========================================================================
   5. KEBAB DROPDOWN MENU
   ========================================================================== */
.kebab-wrapper {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

.kebab-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--text-muted) !important;
    font-size: 20px !important;
    font-weight: bold !important;
    padding: 0 !important;
    cursor: pointer !important;
    line-height: 1 !important;
    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s, color 0.2s !important;
    transform: none !important;
    margin: 0 !important;
}

.kebab-btn:hover,
.kebab-btn:focus {
    background: var(--kebab-hover, rgba(0, 0, 0, 0.06)) !important;
    color: var(--text-main) !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.kebab-dropdown {
    position: absolute !important;
    right: 0 !important;
    top: 100% !important;
    margin-top: 4px !important;
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--border-color, #cbd5e1) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    z-index: 9999 !important;
    min-width: 150px !important;
    overflow: hidden !important;
    padding: 4px !important;
}

.kebab-dropdown.hidden { 
    display: none !important; 
}

.kebab-dropdown.show,
.kebab-dropdown.active,
.kebab-dropdown:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.dark-theme .kebab-dropdown,
body.dark-mode .kebab-dropdown {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.kebab-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 10px 14px !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-main) !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-align: left !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    transition: background 0.15s ease !important;
    white-space: nowrap !important;
}

.kebab-item:hover {
    background: var(--comment-bg, #f1f5f9) !important;
}

body.dark-theme .kebab-item:hover,
body.dark-mode .kebab-item:hover {
    background: #334155 !important;
}

.kebab-item.danger {
    color: #ef4444 !important;
}

.kebab-item.danger:hover {
    background: rgba(239, 68, 68, 0.12) !important;
}

/* ==========================================================================
   6. ACTIONS & COMMENTARY SECTION
   ========================================================================== */
.post-actions-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding-top: 6px !important;
    margin-top: 6px !important;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    min-height: 26px;
    transition: background 0.18s, color 0.18s, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.action-btn:hover {
    background: var(--comment-bg);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-icon {
    transition: transform 0.22s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.action-btn:hover .action-icon {
    transform: scale(1.18);
}

.comments-wrapper {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
}

.comments-wrapper:not(.hidden) {
    animation: timelineSlideDown 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes timelineSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comments-wrapper.hidden { display: none !important; }

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

/* Comment Item - Poster-Style Layout */
.comment-item { 
    background: transparent !important; 
    padding: 10px 0 12px 0 !important; 
    border-radius: 0 !important; 
    font-size: 14px; 
    display: flex !important; 
    flex-direction: column !important;
    border: none !important;
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
    box-shadow: none !important;
}

.comment-item:last-child {
    border-bottom: none !important;
    padding-bottom: 4px !important;
}

.comment-sender-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-bottom: 4px !important;
}

.comment-sender-name {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
}

.comment-time {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 11.5px !important;
    color: var(--text-muted) !important;
    margin-top: 1px !important;
}

.comment-body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--text-main) !important;
    line-height: 1.5 !important;
    margin: 2px 0 0 46px !important;
    padding: 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

.comment-content {
    color: var(--text-main);
    line-height: 1.5;
    overflow-wrap: break-word;
    word-break: break-word;
}

.comment-content strong { 
    color: var(--primary-color); 
    margin-right: 6px;
}

.reply-box { 
    display: flex !important; 
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important; 
    margin-top: 12px !important; 
    width: 100% !important;
    box-sizing: border-box !important;
}

.reply-box input,
.reply-box input[type="text"],
.reply-box .reply-input { 
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px 16px !important; 
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important; 
    border-radius: 20px !important; 
    font-size: 14px !important; 
    height: 42px !important;
    min-height: 42px !important;
    outline: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.reply-box input:focus,
.reply-box input[type="text"]:focus,
.reply-box .reply-input:focus {
    border-color: var(--primary-color) !important;
}

.reply-box button,
.reply-box .reply-submit-btn { 
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    width: auto !important;
    background: #10b981 !important; 
    color: #ffffff !important; 
    border: none !important; 
    border-radius: 20px !important; 
    padding: 0 20px !important; 
    cursor: pointer !important; 
    font-size: 14px !important; 
    font-weight: 700 !important;
    height: 42px !important;
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.reply-box button:hover,
.reply-box .reply-submit-btn:hover {
    background: #059669 !important;
    color: #ffffff !important;
    border: none !important;
    transform: none !important;
}

.hidden { display: none !important; }

/* ==========================================================================
   7. NAVIGATION & LOGIN SCREEN
   ========================================================================== */
.top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.nav-controls { display: flex; gap: 10px; align-items: center; }

.theme-toggle-btn {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    min-height: 40px;
}

.login-box { 
    max-width: 420px; 
    margin: 40px auto; 
    background: var(--card-bg); 
    padding: 32px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); 
    text-align: center; 
    border: 1px solid var(--border-color);
}

.login-box input { 
    width: 100%; 
    padding: 12px; 
    margin: 8px 0 16px 0; 
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    min-height: 44px;
}

.login-box button { 
    width: 100%; 
    padding: 12px; 
    background: var(--primary-color); 
    color: white; 
    border: none; 
    border-radius: 8px; 
    font-weight: bold; 
    font-size: 16px;
    min-height: 44px;
    cursor: pointer; 
}

/* ==========================================================================
   CLASS TARGETING & AUDIENCE BADGES
   ========================================================================== */
body.dark-mode .target-selector-wrapper select,
body.dark-theme .target-selector-wrapper select,
body.dark-mode #postTargetClass,
body.dark-theme #postTargetClass {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

body.dark-mode .target-selector-wrapper select option,
body.dark-theme .target-selector-wrapper select option,
body.dark-mode #postTargetClass option,
body.dark-theme #postTargetClass option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

.target-selector-wrapper select:focus,
#postTargetClass:focus {
    border-color: var(--primary-color) !important;
}

.target-class-badge {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important; /* CRITICAL: Never wrap Grade 12 onto two lines */
    flex-shrink: 0 !important;
    line-height: 1 !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    margin-left: 6px !important;
    background: var(--avatar-bg, #dbeafe) !important;
    color: var(--avatar-text, #1d4ed8) !important;
    border: 1px solid var(--border-color, #cbd5e1) !important;
    box-sizing: border-box !important;
}

body.dark-mode .target-class-badge,
body.dark-theme .target-class-badge {
    background: rgba(37, 99, 235, 0.2) !important;
    color: #93c5fd !important;
    border-color: rgba(147, 197, 253, 0.3) !important;
}

/* Notifications & Mentions */
.notif-wrapper { position: relative; }
#notifToggleBtn.notif-btn,
.notif-btn { 
    background: #ffffff !important; 
    color: #1e293b !important; 
    border: 1.5px solid #cbd5e1 !important; 
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    padding: 0 !important; 
    border-radius: 50% !important; 
    cursor: pointer !important; 
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}
#notifToggleBtn.notif-btn:hover,
.notif-btn:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    transform: scale(1.05) !important;
}
#notifToggleBtn.notif-btn svg,
.notif-btn svg {
    width: 15px !important;
    height: 15px !important;
    stroke: #1e293b !important;
    fill: none !important;
    stroke-width: 2.2 !important;
    color: #1e293b !important;
    display: block !important;
    pointer-events: none !important;
}
.notif-badge { 
    position: absolute !important; 
    top: -4px !important; 
    right: -4px !important; 
    background: #ef4444 !important; 
    color: #ffffff !important; 
    font-size: 10px !important; 
    padding: 1px 5px !important; 
    border-radius: 10px !important; 
    font-weight: 800 !important; 
    display: none; 
}
body.dark-theme #notifToggleBtn.notif-btn,
body.dark-mode #notifToggleBtn.notif-btn,
body.dark-theme .notif-btn,
body.dark-mode .notif-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
body.dark-theme #notifToggleBtn.notif-btn svg,
body.dark-mode #notifToggleBtn.notif-btn svg,
body.dark-theme .notif-btn svg,
body.dark-mode .notif-btn svg {
    stroke: #f8fafc !important;
    color: #f8fafc !important;
}
.notif-dropdown { display: none; position: absolute; top: 38px; right: 0; width: 300px; max-height: 340px; overflow-y: auto; background: var(--card-bg, #ffffff); border: 1px solid var(--border-color, #e2e8f0); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); z-index: 9999; }
.notif-item { padding: 12px 14px; border-bottom: 1px solid var(--border-color); font-size: 14px; cursor: pointer; color: var(--text-main); }
.notif-item:hover { background: var(--comment-bg); }
.notif-item.unread { font-weight: bold; background: var(--avatar-bg); border-left: 3px solid var(--primary-color); }

/* Compact Navbar Action Buttons in Desktop Header */
.desktop-user-actions button,
.desktop-user-actions .theme-toggle-btn,
.desktop-user-actions .teacher-btn,
.desktop-user-actions #studentLogoutBtn,
.desktop-user-actions .logout-btn,
.desktop-user-actions .btn-circle {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: none !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.desktop-user-actions .btn-circle:hover,
.desktop-user-actions .theme-toggle-btn:hover,
.desktop-user-actions #darkModeToggle:hover,
.desktop-user-actions .teacher-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    transform: translateY(-1px) scale(1.05) !important;
}

.desktop-user-actions #studentLogoutBtn,
.desktop-user-actions .logout-btn {
    background: rgba(239, 68, 68, 0.18) !important;
    border: 1.5px solid rgba(239, 68, 68, 0.45) !important;
    color: #f87171 !important;
}

.desktop-user-actions #studentLogoutBtn:hover,
.desktop-user-actions .logout-btn:hover {
    background: rgba(239, 68, 68, 0.35) !important;
    border-color: rgba(239, 68, 68, 0.7) !important;
    color: #ffffff !important;
    transform: translateY(-1px) scale(1.05) !important;
}

.desktop-user-actions button svg,
.desktop-user-actions .btn-circle svg,
.desktop-user-actions svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    fill: none !important;
    stroke: #ffffff !important;
    stroke-width: 2.2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    flex-shrink: 0 !important;
    pointer-events: none !important;
    transition: stroke 0.2s ease !important;
}

.desktop-user-actions #studentLogoutBtn svg,
.desktop-user-actions .logout-btn svg {
    stroke: #f87171 !important;
}

.desktop-user-actions #studentLogoutBtn:hover svg,
.desktop-user-actions .logout-btn:hover svg {
    stroke: #ffffff !important;
}

/* Theme Icon Swapping System: Light Mode -> Moon visible, Sun hidden; Dark Mode -> Sun visible, Moon hidden */
.theme-icon-sun,
svg.theme-icon-sun,
.desktop-user-actions .theme-icon-sun,
.desktop-user-actions svg.theme-icon-sun {
    display: none !important;
}

.theme-icon-moon,
svg.theme-icon-moon,
.desktop-user-actions .theme-icon-moon,
.desktop-user-actions svg.theme-icon-moon {
    display: inline-block !important;
}

body.dark-theme .theme-icon-sun,
body.dark-theme svg.theme-icon-sun,
body.dark-theme .desktop-user-actions .theme-icon-sun,
body.dark-theme .desktop-user-actions svg.theme-icon-sun,
body.dark-mode .theme-icon-sun,
body.dark-mode svg.theme-icon-sun,
body.dark-mode .desktop-user-actions .theme-icon-sun,
body.dark-mode .desktop-user-actions svg.theme-icon-sun {
    display: inline-block !important;
}

body.dark-theme .theme-icon-moon,
body.dark-theme svg.theme-icon-moon,
body.dark-theme .desktop-user-actions .theme-icon-moon,
body.dark-theme .desktop-user-actions svg.theme-icon-moon,
body.dark-mode .theme-icon-moon,
body.dark-mode svg.theme-icon-moon,
body.dark-mode .desktop-user-actions .theme-icon-moon,
body.dark-mode .desktop-user-actions svg.theme-icon-moon {
    display: none !important;
}

.mention-popup { position: absolute; background: var(--card-bg); border: 1px solid var(--border-color); max-height: 200px; overflow-y: auto; z-index: 1000; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); border-radius: 8px; }
.mention-item { padding: 12px 14px; font-size: 14px; cursor: pointer; color: var(--text-main); border-bottom: 1px solid var(--border-color); }
.mention-item:last-child { border-bottom: none; }
.mention-item:hover { background: var(--avatar-bg); color: var(--primary-color); font-weight: bold; }

/* ==========================================================================
   8. RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 768px) {
    body { padding: 0 !important; margin: 0 !important; }
    .app-container { width: 100% !important; padding: 0 !important; margin: 0 !important; }
    .sidebar, .student-sidebar { width: 100% !important; border-radius: 0 !important; padding: 0 12px !important; }
    .desktop-menu-bar, .desktop-user-actions, .user-profile-bottom, .sidebar .user-profile-bottom, .student-sidebar .user-profile-bottom { display: none !important; }
    .mobile-kebab-container { display: block !important; }
    .main-wrapper { padding: 8px 12px calc(32px + env(safe-area-inset-bottom, 0px)) !important; }
    .timeline-container { width: 100% !important; }
    .top-nav { flex-direction: row; gap: 10px; }

    /* Composer on mobile */
    .post-box {
        padding: 14px 14px 12px !important;
        margin-bottom: 14px !important;
        border-radius: 16px !important;
    }

    .post-box textarea,
    #postMessage {
        padding: 10px 12px !important;
        font-size: 14.5px !important;
        min-height: 75px !important;
        margin: 4px 0 8px 0 !important;
        border-radius: 10px !important;
    }

    /* Single-line sleek bottom toolbar below post text box */
    .post-options-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        padding-top: 10px !important;
        margin-top: 4px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .composer-action-tools {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .btn-composer-tool {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        padding: 0 8px !important;
        font-size: 12.5px !important;
        border-radius: 8px !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .btn-composer-tool:hover {
        background: rgba(37, 99, 235, 0.08) !important;
        border: none !important;
        box-shadow: none !important;
    }

    .btn-composer-tool svg {
        width: 16px !important;
        height: 16px !important;
    }

    .target-selector-wrapper {
        position: relative !important;
        display: inline-flex !important;
        align-items: center !important;
        min-width: 0 !important;
        width: auto !important;
        flex-shrink: 0 !important;
    }

    .target-selector-wrapper select,
    #postTargetClass {
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        padding: 0 28px 0 10px !important;
        font-size: 12px !important;
        border-radius: 18px !important;
        min-width: 105px !important;
        max-width: none !important;
        width: auto !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

    #submitPostBtn {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        padding: 0 10px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        color: var(--primary-color, #1e5eff) !important;
        border-radius: 8px !important;
        min-width: fit-content !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
    }

    /* Continuous stream divided by horizontal dividers only (Threads / Twitter style) */
    #timelineFeed {
        border-radius: 16px !important;
        border: 1px solid var(--border-color, #e2e8f0) !important;
        background: var(--card-bg, #ffffff) !important;
        overflow: hidden !important;
    }

    body.dark-theme #timelineFeed,
    body.dark-mode #timelineFeed {
        background: #1e293b !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
    }

    .timeline-post {
        padding: 14px 14px !important;
        margin: 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    body.dark-theme .timeline-post,
    body.dark-mode .timeline-post {
        border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
    }

    .timeline-post:last-child {
        border-bottom: none !important;
    }

    .target-class-badge {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        line-height: 1 !important;
    }

    .dm-floating-btn {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        right: 16px !important;
    }
    .dm-popup-widget {
        bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
        right: 12px !important;
        width: calc(100vw - 24px) !important;
        max-height: calc(100dvh - 100px) !important;
    }
}

@media (max-width: 480px) {
    body { font-size: 14.5px; padding: 0 !important; margin: 0 !important; }
    .main-wrapper { padding: 6px 10px calc(28px + env(safe-area-inset-bottom, 0px)) !important; }
    .reply-box { flex-direction: column; }
    .reply-box button { width: 100%; min-height: 40px; }
    .avatar-circle { width: 38px; height: 38px; font-size: 15px; }
    .avatar-circle.comment-avatar {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        font-size: 12.5px !important;
    }
    .sender-name { font-size: 14px; font-weight: 600; }
    .post-body { 
        font-size: 14px !important;
        line-height: 1.5 !important;
        padding-left: 0;
    }
    .comment-body {
        margin-left: 40px !important;
        font-size: 13.5px !important;
    }
    .action-btn, .reaction-btn {
        min-height: 32px;
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* --- ICON & LOGO UTILITY CLASSES --- */
.brand-badge-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stat-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.btn-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 6px;
    object-fit: contain;
}

/* ==========================================================================
   9. DIRECT MESSAGING (DM) FLOATING WIDGET & CHAT DRAWER
   ========================================================================== */
.dm-floating-btn {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 1000 !important;
    background: #1e5eff !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 10px 18px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 6px 20px rgba(30, 94, 255, 0.35) !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    margin: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    width: auto !important;
}

.dm-floating-btn:hover {
    background: #113f9f !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(30, 94, 255, 0.45) !important;
}

.dm-unread-badge {
    background: #ef4444 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 2px 7px !important;
    border-radius: 12px !important;
    line-height: 1 !important;
}

.dm-popup-widget {
    position: fixed !important;
    bottom: 76px !important;
    right: 24px !important;
    width: 360px !important;
    height: 480px !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100vh - 90px) !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2) !important;
    z-index: 1001 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transition: all 0.25s ease !important;
}

.dm-popup-widget.hidden {
    display: none !important;
}

#dmPopupWidget button {
    box-sizing: border-box !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin: 0 !important;
    transform: none !important;
    box-shadow: none !important;
}

.dm-widget-header {
    background: #0b1437 !important;
    color: #ffffff !important;
    padding: 10px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dm-user-info {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.dm-status-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: #10b981 !important;
    box-shadow: 0 0 6px #10b981 !important;
}

.dm-user-name {
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
}

.dm-subtitle {
    font-size: 11px !important;
    opacity: 0.75 !important;
    color: #a0aec0 !important;
}

.dm-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

#dmPopupWidget .dm-new-chat-btn {
    background: #1e5eff !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 5px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    height: 28px !important;
    min-height: 28px !important;
    width: auto !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

#dmPopupWidget .dm-new-chat-btn:hover {
    background: #113f9f !important;
    color: #ffffff !important;
}

#dmPopupWidget .dm-icon-btn {
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    font-size: 18px !important;
    width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#dmPopupWidget .dm-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

.dm-view-section {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: var(--card-bg) !important;
}

.dm-view-section.hidden {
    display: none !important;
}

/* THREADS & CONTACTS LISTS */
.dm-threads-list,
.dm-contacts-list {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 4px 0 !important;
}

.dm-thread-item,
.dm-contact-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid var(--border-color) !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
}

.dm-thread-item:hover,
.dm-contact-item:hover {
    background: var(--comment-bg) !important;
}

.dm-contact-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: var(--avatar-bg) !important;
    color: var(--avatar-text) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
}

.dm-contact-info {
    flex: 1 !important;
    margin: 0 10px !important;
    overflow: hidden !important;
}

.dm-contact-name {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.dm-preview-text {
    font-size: 11.5px !important;
    color: var(--text-muted) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-top: 2px !important;
}

#dmContactsList .dm-new-chat-btn,
.dm-contact-item .dm-new-chat-btn {
    background: #1e5eff !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    height: 26px !important;
    min-height: 26px !important;
    width: auto !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.dm-search-bar {
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--card-bg) !important;
}

.dm-search-bar input {
    flex: 1 !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 14px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
    outline: none !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
}

#dmPopupWidget .dm-back-btn {
    background: transparent !important;
    border: none !important;
    color: #1e5eff !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    height: 28px !important;
    min-height: 28px !important;
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
}

#dmPopupWidget .dm-back-btn:hover {
    background: var(--comment-bg) !important;
}

/* CHATROOM STREAM */
.dm-chatroom-bar {
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: var(--comment-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.dm-partner-info { flex: 1 !important; }

.dm-partner-name {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
}

.dm-partner-role {
    font-size: 11px !important;
    color: var(--text-muted) !important;
}

#dmPopupWidget .kebab-dropdown {
    position: absolute !important;
    top: 32px !important;
    right: 0 !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
    z-index: 1005 !important;
    min-width: 130px !important;
    padding: 4px 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

#dmPopupWidget .kebab-dropdown.hidden {
    display: none !important;
}

#dmPopupWidget .kebab-item {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    text-align: left !important;
}

#dmPopupWidget .kebab-item:hover {
    background: var(--comment-bg) !important;
}

.dm-messages-stream {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.dm-message-bubble {
    max-width: 80% !important;
    padding: 8px 12px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
}

.dm-msg-sent {
    align-self: flex-end !important;
    background: #1e5eff !important;
    color: #ffffff !important;
    border-bottom-right-radius: 3px !important;
}

.dm-msg-received {
    align-self: flex-start !important;
    background: var(--comment-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-bottom-left-radius: 3px !important;
}

.dm-msg-time {
    font-size: 9.5px !important;
    opacity: 0.75 !important;
    margin-top: 3px !important;
    text-align: right !important;
}

.dm-message-input-bar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    border-top: 1px solid var(--border-color) !important;
    background: var(--card-bg) !important;
}

.dm-message-input-bar input {
    flex: 1 !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    border-radius: 18px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
    outline: none !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
}

.dm-message-input-bar button {
    background: #1e5eff !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 0 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    height: 34px !important;
    min-height: 34px !important;
    width: auto !important;
    cursor: pointer !important;
}

.dm-empty-state {
    padding: 20px 14px !important;
    text-align: center !important;
    font-size: 12.5px !important;
    color: var(--text-muted) !important;
}

.action-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    object-fit: contain;
}

.staff-badge-img {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-left: 4px;
    object-fit: contain;
}

/* Custom Font for Timeline Heading */
.timeline-heading {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    color: var(--primary-color);
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ==========================================================================
   TIMELINE FEED FILTER TABS (SEAMLESS / BOXLESS)
   ========================================================================== */
.timeline-tabs-wrapper {
    margin-bottom: 14px !important;
    width: 100% !important;
}

.timeline-tabs-nav {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    background: transparent !important;
    padding: 0 4px !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

body.dark-theme .timeline-tabs-nav,
body.dark-mode .timeline-tabs-nav {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.timeline-tab-item,
button.timeline-tab-item,
#tabBtnAllPosts,
#tabBtnMyClass,
#tabBtnClassWrapper {
    all: unset !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-muted, #64748b) !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: color 0.18s ease, background-color 0.18s ease !important;
    user-select: none !important;
    min-height: 34px !important;
    height: 34px !important;
    width: auto !important;
    max-width: fit-content !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.timeline-tab-item:hover,
button.timeline-tab-item:hover,
#tabBtnAllPosts:hover,
#tabBtnMyClass:hover {
    color: var(--text-main, #0f172a) !important;
    background: rgba(15, 23, 42, 0.05) !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

body.dark-theme .timeline-tab-item:hover,
body.dark-mode .timeline-tab-item:hover,
body.dark-theme button.timeline-tab-item:hover,
body.dark-mode button.timeline-tab-item:hover,
body.dark-theme #tabBtnAllPosts:hover,
body.dark-mode #tabBtnAllPosts:hover,
body.dark-theme #tabBtnMyClass:hover,
body.dark-mode #tabBtnMyClass:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.timeline-tab-item.active,
button.timeline-tab-item.active,
#tabBtnAllPosts.active,
#tabBtnMyClass.active,
#tabBtnClassWrapper.active {
    background: transparent !important;
    color: var(--primary-color, #1e5eff) !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    border: none !important;
    border-bottom: 2.5px solid var(--primary-color, #1e5eff) !important;
    border-radius: 0 !important;
}

body.dark-theme .timeline-tab-item.active,
body.dark-mode .timeline-tab-item.active,
body.dark-theme button.timeline-tab-item.active,
body.dark-mode button.timeline-tab-item.active,
body.dark-theme #tabBtnAllPosts.active,
body.dark-mode #tabBtnAllPosts.active,
body.dark-theme #tabBtnMyClass.active,
body.dark-mode #tabBtnMyClass.active,
body.dark-theme #tabBtnClassWrapper.active,
body.dark-mode #tabBtnClassWrapper.active {
    background: transparent !important;
    color: #3b82f6 !important;
    border: none !important;
    border-bottom: 2.5px solid #3b82f6 !important;
}

.timeline-tab-item.tab-with-select {
    cursor: default !important;
}

.timeline-tab-item.tab-with-select span {
    cursor: pointer !important;
}

.timeline-tab-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: transparent !important;
    color: inherit !important;
    border: 1px solid var(--border-color, #cbd5e1) !important;
    border-radius: 7px !important;
    padding: 3px 22px 3px 7px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    outline: none !important;
    min-width: 95px !important;
    max-width: 170px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%231e5eff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1 5 5 9 1'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 6px center !important;
    background-size: 8px 5px !important;
}

.timeline-tab-item:not(.active) .timeline-tab-select {
    color: var(--text-muted, #64748b) !important;
    border-color: var(--border-color, #cbd5e1) !important;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1 5 5 9 1'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 6px center !important;
    background-size: 8px 5px !important;
}

body.dark-theme .timeline-tab-select,
body.dark-mode .timeline-tab-select {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1 5 5 9 1'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 6px center !important;
    background-size: 8px 5px !important;
}

body.dark-theme .timeline-tab-item:not(.active) .timeline-tab-select,
body.dark-mode .timeline-tab-item:not(.active) .timeline-tab-select {
    color: #94a3b8 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1 5 5 9 1'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 6px center !important;
    background-size: 8px 5px !important;
}

.timeline-tab-select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

body.dark-theme .timeline-tab-select option,
body.dark-mode .timeline-tab-select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}