/* Base Styles */
:root {
    --bg: #f8f9fa;
    --text: #2d3436;
    --muted: #636e72;
    --card: #ffffff;
    --accent: #4361ee;
    --border: #e9ecef;
    --hover: #f1f3f5;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    --radius: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2f4fcd;
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Global Navigation */
.global-nav {
    background: #fff;
    border-bottom: 1px solid #e5e5e8;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.global-nav .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
}

.global-nav-item {
    color: #666;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

.global-nav-item:hover {
    color: #2c7be5;
}

.global-nav-item.active {
    color: #2c7be5;
    font-weight: 600;
}

/* Header */
.header {
    background: var(--card);
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo a {
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Navigation */
.nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav a {
    display: inline-block;
    padding: 0.8em 2.2em;
    background: rgba(29,43,76,0.85);
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(29,43,76,0.08);
}

.nav a:hover {
    background: rgba(29,43,76,1);
    color: #fff;
    text-decoration: none;
}

.nav a.active {
    background: rgba(29,43,76,1);
    color: #fff;
}

/* Sidebar-left specific button styling */
.sidebar-left .nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8em 1.2em;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.2s ease;
    background: rgba(29,43,76,0.85);
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(29,43,76,0.08);
    border: none;
}

.sidebar-left .nav a:hover {
    background: rgba(29,43,76,1);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(29,43,76,0.12);
}

.sidebar-left .nav a.active {
    background: rgba(29,43,76,1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(29,43,76,0.12);
}

/* Main Content */
.main {
    padding: 2.5rem 0;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.layout {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 24px;
}

.sidebar-left,
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.feed-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #e0e0e0;
}

.card h3 {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.card h3 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.card h3 a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Meta Information */
.meta {
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 8px;
    flex-wrap: wrap;
}

.meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tag {
    display: inline-block;
    padding: 4px 10px;
    background: #eef2ff;
    color: #334155;
    border-radius: 16px;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8em 2.2em;
    border-radius: 30px;
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.2s ease;
    background: rgba(29,43,76,0.85);
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(29,43,76,0.08);
    border: none;
}

.btn:hover {
    background: rgba(29,43,76,1);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(29,43,76,0.12);
}

.btn.primary {
    background: rgba(29,43,76,0.85);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(29,43,76,0.08);
}

.btn.primary:hover {
    background: rgba(29,43,76,1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(29,43,76,0.12);
}

/* Post Content */
.post-body {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-top: 12px;
    color: var(--text);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Forms */
.form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.form .row {
    margin-bottom: 1rem;
}

.form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form input,
.form select,
.form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* Comments */
.comments {
    margin-top: 2rem;
}

.comment {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
    transition: all 0.2s ease;
}

.comment:hover {
    border-color: #e0e0e0;
}
.zoomable {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.zoomable img {
    transition: transform 0.25s ease;
    display: block;
}
.zoomable:hover img {
    transform: scale(1.04);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar-left,
    .sidebar-right {
        position: static;
        max-height: none;
    }
    
    .sidebar-right {
        order: 3;
    }
    
    .sidebar-left {
        order: 1;
    }
    
    .feed-main {
        order: 2;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
}
