:root {
    /* Light theme */
    --bg-color: #ffffff;
    --text-color: #121212;
    --accent-color: #333333;
    --muted-color: #666666;
    --border-color: #e5e5e5;
    --card-bg: #ffffff;
    --timeline-bg: rgba(0, 0, 0, 0.02);
    --timeline-line: rgba(0, 0, 0, 0.08);
    --timeline-point: #333333;
    --timeline-point-active: #000000;
    --button-bg: rgba(0, 0, 0, 0.04);
    --button-hover-bg: rgba(0, 0, 0, 0.08);
    --button-color: #333333;
    --button-active-bg: rgba(0, 0, 0, 0.7);
    --button-active-color: #ffffff;
    --timeline-width: 80px;
    --timeline-marker-size: 6px;
    --transition-speed: 0.22s;
    --transition-timing: cubic-bezier(0.2, 0.8, 0.2, 1);
    --hover-transition: 0.18s ease-out;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.07);
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --header-height: 60px;
}

[data-theme="dark"] {
    /* Dark theme */
    --bg-color: #111111;
    --text-color: #e0e0e0;
    --accent-color: #bbbbbb;
    --muted-color: #999999;
    --border-color: #252525;
    --card-bg: #181818;
    --timeline-bg: rgba(255, 255, 255, 0.02);
    --timeline-line: rgba(255, 255, 255, 0.08);
    --timeline-point: #777777;
    --timeline-point-active: #ffffff;
    --button-bg: rgba(255, 255, 255, 0.04);
    --button-hover-bg: rgba(255, 255, 255, 0.08);
    --button-color: #bbbbbb;
    --button-active-bg: rgba(255, 255, 255, 0.7);
    --button-active-color: #111111;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 5px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Auto theme - uses system preference */
[data-theme="auto"] {
    /* Light theme by default */
    --bg-color: #ffffff;
    --text-color: #121212;
    --accent-color: #333333;
    --muted-color: #666666;
    --border-color: #e5e5e5;
    --card-bg: #ffffff;
    --timeline-bg: rgba(0, 0, 0, 0.02);
    --timeline-line: rgba(0, 0, 0, 0.08);
    --timeline-point: #333333;
    --timeline-point-active: #000000;
    --button-bg: rgba(0, 0, 0, 0.04);
    --button-hover-bg: rgba(0, 0, 0, 0.08);
    --button-color: #333333;
    --button-active-bg: rgba(0, 0, 0, 0.7);
    --button-active-color: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.07);
}

/* Auto theme - dark mode when system prefers dark */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg-color: #111111;
        --text-color: #e0e0e0;
        --accent-color: #bbbbbb;
        --muted-color: #999999;
        --border-color: #252525;
        --card-bg: #181818;
        --timeline-bg: rgba(255, 255, 255, 0.02);
        --timeline-line: rgba(255, 255, 255, 0.08);
        --timeline-point: #777777;
        --timeline-point-active: #ffffff;
        --button-bg: rgba(255, 255, 255, 0.04);
        --button-hover-bg: rgba(255, 255, 255, 0.08);
        --button-color: #bbbbbb;
        --button-active-bg: rgba(255, 255, 255, 0.7);
        --button-active-color: #111111;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
        --shadow-md: 0 2px 5px rgba(0, 0, 0, 0.15);
        --shadow-lg: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-speed: 0.1s;
        --transition-timing: ease;
    }
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), 
                color var(--transition-speed);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main container */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Timeline */
.timeline {
    width: var(--timeline-width);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background-color: var(--timeline-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 0;
    z-index: 10;
    transition: background-color var(--transition-speed);
}

.timeline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 1px;
    background-color: var(--timeline-line);
    transform: translateX(-50%);
    transition: background-color var(--transition-speed);
}

.timeline-point {
    position: relative;
    width: var(--timeline-marker-size);
    height: var(--timeline-marker-size);
    border-radius: 50%;
    background-color: var(--timeline-point);
    margin: 20px 0;
    cursor: pointer;
    z-index: 2;
    transition: transform var(--hover-transition), 
                background-color var(--transition-speed),
                opacity 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.timeline-point.active {
    transform: scale(1.25);
    background-color: var(--timeline-point-active);
    box-shadow: var(--shadow-md);
}

.timeline-point:hover {
    transform: scale(1.15);
}

.timeline-point.active:hover {
    transform: scale(1.25);
}

.timeline-point.filtered-out {
    opacity: 0.3;
    transform: scale(0.7);
}

.timeline-date {
    position: absolute;
    left: var(--timeline-width);
    top: 50%;
    transform: translateY(-50%) translateX(-2px);
    white-space: nowrap;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity var(--transition-speed) var(--transition-timing),
                transform var(--transition-speed) var(--transition-timing);
    padding: 3px 7px;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 3px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
    pointer-events: none;
    letter-spacing: 0.2px;
}

.timeline-point:hover .timeline-date,
.timeline-point.active .timeline-date {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.timeline-marker {
    position: absolute;
    width: var(--timeline-marker-size);
    height: var(--timeline-marker-size);
    border-radius: 50%;
    border: 1.5px solid var(--timeline-point-active);
    background-color: transparent;
    left: 50%;
    transform: translateX(-50%) scale(1.6);
    z-index: 3;
    transition: top 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
                border-color var(--transition-speed),
                transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.3s ease;
    box-shadow: 0 0 0 3px rgba(var(--timeline-point-active-rgb, 0, 0, 0), 0.05);
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.theme-switch {
    background: var(--button-bg);
    color: var(--button-color);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--hover-transition), 
                transform 0.14s ease;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

.theme-switch:hover {
    background: var(--button-hover-bg);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.theme-switch:active {
    transform: scale(0.96);
}

.theme-icon {
    transition: opacity 0.2s ease, transform 0.2s ease;
    color: var(--button-color);
    position: absolute;
}

/* Show only appropriate icon based on theme */
[data-theme="light"] .light-icon {
    opacity: 1;
}

[data-theme="light"] .dark-icon,
[data-theme="light"] .auto-icon {
    opacity: 0;
}

[data-theme="dark"] .dark-icon {
    opacity: 1;
}

[data-theme="dark"] .light-icon,
[data-theme="dark"] .auto-icon {
    opacity: 0;
}

[data-theme="auto"] .auto-icon {
    opacity: 1;
}

[data-theme="auto"] .light-icon,
[data-theme="auto"] .dark-icon {
    opacity: 0;
}

/* Content */
.content-container {
    flex: 1;
    margin-left: var(--timeline-width);
    position: relative;
}

.posts-container {
    position: relative;
    min-height: 100vh;
}

.post {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, 
                transform 0.3s ease, 
                visibility 0.3s ease;
    overflow-y: auto;
    transform: translateY(6px) scale(0.995);
    will-change: transform, opacity;
}

.post[data-active="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    z-index: 2;
}

.post-inner {
    max-width: 740px;
    margin: 0 auto;
    padding: 80px 40px;
}

.post-title {
    font-size: 2.5rem;
    margin-bottom: 10px; /* Reduce margin */
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.post-date {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin-bottom: 0; /* Remove bottom margin */
    transition: color var(--transition-speed);
    letter-spacing: 0.3px;
}

.post-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px; /* Reduced from 40px */
}

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
}

.post-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-weight: 500;
}

.post-category:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 30px 0;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-speed);
}

.post-content h1, .post-content h2, 
.post-content h3, .post-content h4 {
    margin: 40px 0 16px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--accent-color-rgb, 0, 0, 0), 0.3);
    transition: color var(--transition-speed), 
                border-color var(--transition-speed), 
                opacity 0.2s ease;
    padding-bottom: 1px;
}

.post-content a:hover {
    opacity: 0.8;
    border-bottom: 1px solid currentColor;
}

.post-content blockquote {
    border-left: 3px solid var(--accent-color);
    padding-left: 20px;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: var(--muted-color);
}

.post-content pre {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.9em;
    line-height: 1.5;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: rgba(128, 128, 128, 0.07);
    padding: 2px 4px;
    border-radius: 3px;
    color: var(--accent-color);
}

.post-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

.post-content ul, .post-content ol {
    margin: 0 0 24px 20px;
}

.post-content li {
    margin-bottom: 10px;
}

.post-content hr {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 30px 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.9em;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.post-content th, .post-content td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
}

.post-content th {
    background-color: var(--button-bg);
    font-weight: 600;
}

.post-content tr:nth-child(even) {
    background-color: rgba(128, 128, 128, 0.03);
}

/* Post navigation */
.post-navigation {
    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 14px;
    z-index: 100;
    opacity: 0.5;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(8px);
    padding: 5px;
    border-radius: 20px;
    background: rgba(var(--bg-color-rgb, 255, 255, 255), 0.4);
}

.post-navigation:hover {
    opacity: 1;
}

.nav-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--button-bg);
    border: none;
    color: var(--button-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.14s ease, 
                background-color var(--hover-transition), 
                box-shadow 0.14s ease;
    box-shadow: var(--shadow-sm);
}

.nav-button:hover {
    transform: translateY(-1px);
    background-color: var(--button-hover-bg);
    box-shadow: var(--shadow-md);
}

.nav-button:active {
    transform: translateY(0) scale(0.97);
    box-shadow: var(--shadow-sm);
}

.nav-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    padding: 20px;
    opacity: 0.8;
}

.empty-state h2 {
    margin-bottom: 20px;
    font-weight: 500;
}

/* Smooth fades for content */
.post[data-active="true"] .post-title,
.post[data-active="true"] .post-date,
.post[data-active="true"] .post-content {
    animation: subtleFadeIn 0.5s var(--transition-timing) forwards;
    opacity: 0;
}

.post[data-active="true"] .post-date {
    animation-delay: 0.04s;
}

.post[data-active="true"] .post-content {
    animation-delay: 0.08s;
}

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

/* Responsive design */
@media (min-width: 1600px) {
    html {
        font-size: 18px;
    }
    
    .post-inner {
        max-width: 800px;
    }
}

@media (max-width: 1200px) {
    .post-inner {
        max-width: 680px;
    }
}

@media (max-width: 768px) {
    :root {
        --timeline-width: 40px;
    }
    
    html {
        font-size: 15px;
    }
    
    .post-title {
        font-size: 2.2rem;
    }
    
    .post-inner {
        max-width: 100%;
        padding: 70px 25px;
    }
    
    .theme-switch {
        width: 36px;
        height: 36px;
        top: 16px;
        right: 16px;
    }
    
    .nav-button {
        width: 32px;
        height: 32px;
    }
    
    /* Timeline improvements */
    .timeline {
        padding: 40px 0;
        background-color: rgba(var(--bg-color-rgb, 255, 255, 255), 0.4);
        backdrop-filter: blur(4px);
    }
    
    .timeline::after {
        left: 45%;
    }
    
    .timeline-point {
        width: 5px;
        height: 5px;
    }
    
    /* Category filter positioning */
    .category-filter {
        bottom: 70px;
        top: auto;
        max-width: 85%;
        border-radius: 20px;
        box-shadow: var(--shadow-lg);
    }
    
    .category-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding: 5px 8px;
    }
}

@media (max-width: 576px) {
    :root {
        --timeline-width: 28px;
        --timeline-marker-size: 4px;
    }
    
    html {
        font-size: 14px;
    }
    
    .post-title {
        font-size: 1.8rem;
    }
    
    .post-inner {
        padding: 50px 15px;
    }
    
    .post-navigation {
        bottom: 15px;
    }
    
    .nav-button {
        width: 30px;
        height: 30px;
    }
    
    .theme-switch {
        width: 32px;
        height: 32px;
        top: 12px;
        right: 12px;
    }
    
    /* Timeline enhancements */
    .timeline {
        padding: 30px 0;
        width: var(--timeline-width);
        background: transparent;
        box-shadow: none;
    }
    
    .timeline::after {
        left: 40%;
        opacity: 0.6;
    }
    
    .timeline-point {
        margin: 13px 0;
        transform: scale(0.85);
    }
    
    .timeline-point.active {
        transform: scale(1.1);
    }
    
    .timeline-date {
        font-size: 0.7rem;
        padding: 2px 5px;
        left: calc(var(--timeline-width) - 2px);
    }
    
    /* Hide categories by default on mobile */
    .category-filter {
        transform: translateX(-200%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    .category-filter.visible {
        transform: translateX(-50%);
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Show category toggle button */
    .category-toggle {
        display: flex;
    }
    
    /* Category item adjustments */
    .category-item {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}

/* Mobile landscape support */
@media (max-height: 500px) and (orientation: landscape) {
    .post-inner {
        padding: 40px 20px;
    }
    
    .post-navigation {
        bottom: 15px;
    }
    
    .theme-switch {
        top: 10px;
        right: 10px;
    }
    
    .timeline {
        padding: 20px 0;
    }
    
    .timeline-point {
        margin: 15px 0;
    }
}

/* Print styles */
@media print {
    .theme-toggle, .post-navigation, .timeline {
        display: none;
    }
    
    .content-container {
        margin-left: 0;
    }
    
    .post {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        height: auto;
        page-break-after: always;
    }
    
    .post-inner {
        padding: 0;
        max-width: 100%;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--button-bg);
    border-radius: 3px;
    transition: background-color var(--transition-speed);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--button-hover-bg);
}

/* Focus styles for accessibility */
button:focus, a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

button:focus:not(:focus-visible), a:focus:not(:focus-visible) {
    outline: none;
}

/* Admin styles */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background-color: var(--card-bg);
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    border-right: 1px solid var(--border-color);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.admin-sidebar h1 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    font-weight: 600;
}

.admin-sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0 0 auto 0;
    flex-grow: 1;
}

.admin-sidebar li {
    margin-bottom: 10px;
}

.admin-sidebar a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 10px 15px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color var(--transition-speed);
}

.admin-sidebar a:hover {
    background-color: var(--button-hover-bg);
}

.admin-sidebar li.active a {
    background-color: var(--button-bg);
    font-weight: 500;
}

.admin-content {
    margin-left: 250px;
    flex: 1;
    padding: 30px;
    max-width: 100%;
    z-index: 10;
}

.admin-content h2 {
    margin-bottom: 30px;
    font-weight: 600;
}

/* Form styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color var(--transition-speed), background-color var(--transition-speed), color var(--transition-speed);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    background-color: var(--button-bg);
    color: var(--button-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background-color: var(--button-hover-bg);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-edit {
    background-color: #28a745;
    color: white;
    height: 40px;
    padding: 8px;
}

.btn-edit:hover {
    background-color: #218838;
}

/* Admin posts list */
.posts-list {
    margin-top: 20px;
}

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.post-details h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.post-meta {
    color: var(--muted-color);
    font-size: 0.9rem;
}

.post-actions {
    display: flex;
    gap: 10px;
}

.delete-form {
    display: inline;
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color);
    transition: background-color var(--transition-speed);
    position: relative;
}

.login-box {
    width: 400px;
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.login-box h2 {
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    color: #ff8c94;
    border-color: rgba(220, 53, 69, 0.3);
}

[data-theme="dark"] .alert-info {
    background-color: rgba(13, 202, 240, 0.2);
    color: #8cdaeb;
    border-color: rgba(13, 202, 240, 0.3);
}

/* Admin theme toggle placement */
.admin-theme-toggle {
    margin-top: auto;
    padding: 20px 0;
    display: flex;
    justify-content: center;
}

/* Image upload */
.image-upload {
    margin: 20px 0;
}

.upload-status {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--muted-color);
}

/* SimpleMDE customizations */
.editor-toolbar {
    background-color: var(--bg-color);
    border-color: var(--border-color);
}

.editor-toolbar a {
    color: var(--text-color) !important;
}

.CodeMirror {
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Responsive admin */
@media (max-width: 992px) {
    .admin-sidebar {
        width: 220px;
    }
    .admin-content {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }
    .admin-content {
        margin-left: 200px;
        padding: 20px;
    }
    .login-box {
        width: 80%;
        max-width: 400px;
    }
}

@media (max-width: 576px) {
    .admin-container {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 15px 10px;
        overflow-x: auto;
        justify-content: space-between;
    }
    .admin-sidebar h1 {
        width: 100%;
        margin-bottom: 15px;
        font-size: 1.3rem;
    }
    .admin-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }
    .admin-sidebar li {
        margin-bottom: 0;
    }
    .admin-sidebar a {
        padding: 8px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    .admin-content {
        margin-left: 0;
        padding: 15px;
    }
    .post-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .post-actions {
        margin-top: 10px;
        width: 100%;
    }
    .btn {
        flex: 1;
    }
    .admin-theme-toggle {
        position: absolute;
        top: 15px;
        right: 15px;
        padding: 0;
    }
}

/* Category styles */
.category-filter {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 5px;
    border-radius: 30px;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 5px;
}

.category-item {
    padding: 5px 12px;
    border-radius: 20px;
    border: none;
    background-color: var(--button-bg);
    color: var(--button-color);
    cursor: pointer;
    font-size: 0.85rem;
    transition: transform 0.2s ease, opacity 0.2s ease,
                box-shadow 0.2s ease,
                background-color 0.2s ease;
    font-weight: 500;
}

.category-item.all-categories {
    background-color: var(--button-bg);
}

.category-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.category-item:active {
    transform: translateY(1px);
}

.category-item.active {
    box-shadow: 0 0 0 2px var(--accent-color);
    font-weight: 600;
}

/* Timeline categories indicators */
.timeline-categories {
    position: absolute;
    left: calc(-1 * var(--timeline-width) / 2 + 15px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.timeline-category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}

/* Admin category management */
.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.category-item-admin {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--category-color, var(--accent-color));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-item-admin:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-color-preview {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    margin-right: 15px;
}

.category-details {
    flex: 1;
}

.category-details h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.category-meta {
    font-size: 0.8rem;
    color: var(--muted-color);
}

.category-actions {
    display: flex;
    gap: 10px;
}

/* Color picker styles */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Post category checkboxes */
.categories-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.category-checkbox {
    position: relative;
}

.category-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.category-checkbox label {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.category-checkbox input:checked + label {
    box-shadow: 0 0 0 2px var(--accent-color);
}

.category-checkbox label:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.action-bar {
    margin-bottom: 20px;
}

/* Responsive styles for categories */
@media (max-width: 768px) {
    .category-filter {
        display: none;
    }
    .timeline-date {
        display: none;
    }
    .timeline-category-dot {
        display: none;
    }

}

@media (max-width: 576px) {
    .categories-list {
        grid-template-columns: 1fr;
    }
    
    .post-categories {
        margin-top: 5px;
    }
}

/* Filtered items */
.filtered-out {
    display: none !important;
}

/* No posts message */
.filtered-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    z-index: 5;
    animation: fadeIn 0.3s ease-in-out;
}

/* Category toggle button for mobile */
.category-toggle {
    display: none;
    position: fixed;
    bottom: 75px;
    left: 20px;
    z-index: 110;
    background-color: var(--card-bg);
    color: var(--button-color);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.14s ease;
}

.category-toggle:hover {
    transform: scale(1.05);
}

.category-toggle:active {
    transform: scale(0.95);
}

.category-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* YouTube Embed and Link Preview Cards */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 25px 0;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    background-color: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.link-preview-card {
    display: flex;
    flex-direction: column;
    margin: 25px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
}

.link-preview-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    border-color: var(--accent-color);
}

.link-preview-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.link-preview-content {
    padding: 15px;
    flex: 1;
}

.link-preview-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.link-preview-description {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-domain {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--muted-color);
}

.link-preview-domain svg {
    width: 14px;
    height: 14px;
    margin-right: 5px;
    fill: currentColor;
}

.link-preview-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 3px;
}

@media (min-width: 768px) {
    .link-preview-card {
        flex-direction: row;
    }
    
    .link-preview-image {
        width: 200px;
        height: auto;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
    }
}

@media (max-width: 576px) {
    .link-preview-image {
        height: 140px;
    }
    
    .link-preview-content {
        padding: 12px;
    }
}
