/* Tech Template CSS */
:root {
  /* Default colors - will be overridden by branding system */
  --primary-color: #0070f3;
  --secondary-color: #7928ca;
  --accent-color: #ff0080;
  --background-color: #ffffff;
  --surface-color: #f8f9fa;
  --text-primary: #000000;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e1e5e9;
  --success-color: #43b581;
  --warning-color: #faa61a;
  --error-color: #f04747;
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 25px rgba(0, 112, 243, 0.15);
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Main */
.main {
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-bottom: 3rem;
    border-radius: 12px;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.stat span {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat small {
    display: block;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Section Headers */
section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

section h3 i {
    color: var(--primary-color);
}

/* Recent Discussions */
.recent-discussions {
    margin-bottom: 3rem;
}

.threads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.thread-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.thread-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow);
}

.thread-header h4 {
    margin-bottom: 0.5rem;
}

.thread-header h4 a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
}

.thread-header h4 a:hover {
    color: var(--primary-color);
}

.thread-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
}

.thread-meta i {
    margin-right: 0.25rem;
}

.thread-content {
    margin: 1rem 0;
}

.thread-content p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.thread-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.thread-stats i {
    margin-right: 0.25rem;
}

/* Channels */
.channels {
    margin-bottom: 3rem;
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.channel-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.channel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow);
}

.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.channel-header h4 a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
}

.server-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.channel-topic {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.channel-stats {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.channel-stats i {
    margin-right: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.view-all {
    text-align: center;
    margin-top: 2rem;
}

/* Footer */
.footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    .threads-grid,
    .channels-grid {
        grid-template-columns: 1fr;
    }

    .thread-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .channel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Thread Page Styles */
.thread-page {
    max-width: 800px;
    margin: 0 auto;
}

.thread-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.thread-info {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.thread-info span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.thread-info i {
    color: var(--primary-color);
    margin-right: 0.25rem;
}

.posts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.post-author {
    font-weight: 600;
    color: var(--text-primary);
}

.post-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.post-content {
    line-height: 1.6;
    color: var(--text-secondary);
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content code {
    background: var(--border-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

/* Search Page */
.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s;
}

.search-result:hover {
    transform: translateX(4px);
}

.search-result h4 {
    margin-bottom: 0.5rem;
}

.search-result h4 a {
    text-decoration: none;
    color: var(--text-primary);
}

.search-result h4 a:hover {
    color: var(--primary-color);
}

.search-result p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.search-result-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Leaderboard */
.leaderboard-section {
    background: var(--background-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
}

.leaderboard-list {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.leaderboard-item:hover {
    background: linear-gradient(90deg, var(--surface-color), transparent);
    transform: translateX(4px);
    border-left: 3px solid var(--primary-color);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

/* Special styling for top 3 */
.leaderboard-item:nth-child(1) {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
    border-left: 4px solid #ffd700;
}

.leaderboard-item:nth-child(2) {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
    border-left: 4px solid #c0c0c0;
}

.leaderboard-item:nth-child(3) {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
    border-left: 4px solid #cd7f32;
}

.leaderboard-rank {
    font-weight: 800;
    font-size: 1.5rem;
    margin-right: 1.5rem;
    min-width: 3rem;
    text-align: center;
    position: relative;
}

/* Rank styling */
.leaderboard-item:nth-child(1) .leaderboard-rank {
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    color: #c0c0c0;
    text-shadow: 0 2px 4px rgba(192, 192, 192, 0.3);
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    color: #cd7f32;
    text-shadow: 0 2px 4px rgba(205, 127, 50, 0.3);
}

.leaderboard-item:nth-child(n+4) .leaderboard-rank {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Crown icons for top 3 */
.leaderboard-item:nth-child(1) .leaderboard-rank::before {
    content: '👑';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
}

.leaderboard-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid var(--background-color);
    position: relative;
}

/* Special avatar effects for top 3 */
.leaderboard-item:nth-child(1) .leaderboard-avatar {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.leaderboard-item:nth-child(2) .leaderboard-avatar {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    box-shadow: 0 4px 20px rgba(192, 192, 192, 0.4);
}

.leaderboard-item:nth-child(3) .leaderboard-avatar {
    background: linear-gradient(135deg, #cd7f32, #deb887);
    box-shadow: 0 4px 20px rgba(205, 127, 50, 0.4);
}

.leaderboard-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.leaderboard-username {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.leaderboard-stats {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.leaderboard-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.leaderboard-stat i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.leaderboard-score {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary-color);
    min-width: 4rem;
    text-align: right;
}

/* Top 3 score styling */
.leaderboard-item:nth-child(1) .leaderboard-score {
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.leaderboard-item:nth-child(2) .leaderboard-score {
    color: #c0c0c0;
    text-shadow: 0 2px 4px rgba(192, 192, 192, 0.3);
}

.leaderboard-item:nth-child(3) .leaderboard-score {
    color: #cd7f32;
    text-shadow: 0 2px 4px rgba(205, 127, 50, 0.3);
}

/* Leaderboard responsive design */
@media (max-width: 768px) {
    .leaderboard-item {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .leaderboard-rank {
        font-size: 1.2rem;
        min-width: 2.5rem;
        margin-right: 1rem;
    }
    
    .leaderboard-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .leaderboard-user {
        gap: 1rem;
    }
    
    .leaderboard-stats {
        font-size: 0.8rem;
        gap: 1rem;
    }
    
    .leaderboard-score {
        font-size: 1.1rem;
        min-width: 3rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.thread-card,
.channel-card,
.post,
.search-result {
    animation: fadeIn 0.5s ease-out;
}

/* Image and Text Overlap Prevention */
/* General image styles to prevent overlap and maintain responsive behavior */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--shadow);
}

/* Images within content containers */
.thread-content img,
.post-content img,
.channel-topic img,
.search-result img {
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
}

/* Inline images within text */
.thread-content img[align="left"],
.post-content img[align="left"] {
    float: left;
    margin: 0.5rem 1rem 1rem 0;
    max-width: 50%;
    display: inline-block;
}

.thread-content img[align="right"],
.post-content img[align="right"] {
    float: right;
    margin: 0.5rem 0 1rem 1rem;
    max-width: 50%;
    display: inline-block;
}

/* Clear floats to prevent text wrapping issues */
.thread-content::after,
.post-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Avatar images - maintain consistent sizing */
.post-avatar img,
.leaderboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    margin: 0;
    box-shadow: none;
}

/* Logo and brand images */
.logo,
.nav-brand img {
    max-height: 40px;
    width: auto;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}

/* Prevent text overflow in containers with images */
.thread-card,
.post,
.search-result,
.channel-card {
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
}

/* Image galleries or multiple images */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.image-gallery img {
    margin: 0;
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.image-gallery img:hover {
    transform: scale(1.02);
}

/* Figures with captions */
figure {
    margin: 1.5rem 0;
    text-align: center;
}

figure img {
    margin: 0 0 0.5rem 0;
    max-width: 100%;
    height: auto;
}

figcaption {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0.5rem 0 0 0;
}

/* Responsive image behavior */
@media (max-width: 768px) {
    /* Stack all images vertically on mobile */
    .thread-content img[align="left"],
    .thread-content img[align="right"],
    .post-content img[align="left"],
    .post-content img[align="right"] {
        float: none;
        display: block;
        margin: 1rem auto;
        max-width: 100%;
    }
    
    /* Reduce image gallery columns on mobile */
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    /* Adjust figure margins */
    figure {
        margin: 1rem 0;
    }
    
    /* Ensure images don't exceed viewport width */
    img {
        max-width: calc(100vw - 2rem);
    }
    
    .thread-content img,
    .post-content img {
        max-width: calc(100vw - 4rem);
    }
}

@media (max-width: 480px) {
    /* Extra small screens - more conservative spacing */
    img {
        margin: 0.75rem 0;
    }
    
    .thread-content img,
    .post-content img {
        margin: 0.75rem auto;
        border-radius: 4px;
    }
    
    .image-gallery img {
        height: 150px;
    }
}

/* Loading and error states for images */
img[src=""],
img:not([src]) {
    opacity: 0;
}

img[alt]:after {
    content: attr(alt);
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface-color);
    color: var(--text-secondary);
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

/* Lazy loading support */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Content spacing adjustments to accommodate images */
.thread-content p + img,
.post-content p + img {
    margin-top: 1.5rem;
}

.thread-content img + p,
.post-content img + p {
    margin-top: 1.5rem;
}

/* Ensure proper spacing in content blocks */
.thread-content > *:first-child,
.post-content > *:first-child {
    margin-top: 0;
}

.thread-content > *:last-child,
.post-content > *:last-child {
    margin-bottom: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #fff;
        --text-secondary: #ccc;
        --text-muted: #888;
        --background-color: #121212;
        --surface-color: #1e1e1e;
        --border-color: #333;
        
    }
}

/* Individual Posts */
.post {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 2rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.post:hover::before {
    opacity: 1;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 184, 212, 0.2);
    border: 2px solid var(--primary-color);
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-info {
    flex: 1;
}

.post-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.post-timestamp {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-timestamp i {
    color: var(--secondary-color);
}

.post-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* Images and Media */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content img {
    margin: 1.5rem 0;
}

.attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 184, 212, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    text-decoration: none;
    margin: 0.5rem 0;
    transition: all 0.3s ease;
}

.attachment:hover {
    background: rgba(0, 184, 212, 0.15);
    transform: translateY(-1px);
}

.embed {
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    background: rgba(0, 184, 212, 0.05);
    border-radius: 0 8px 8px 0;
}

/* User avatars and logos */
.avatar, .logo {
    border-radius: 8px;
    max-width: 60px;
    max-height: 60px;
    object-fit: cover;
    margin: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.logo {
    max-width: 120px;
    max-height: 80px;
}

/* Channel Page Enhancements */
.channel-page {
    max-width: 100%;
}

.channel-header {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.channel-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.channel-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.channel-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.channel-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.channel-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.channel-info i {
    color: var(--primary-color);
}

.channel-threads h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.threads-list {
    display: grid;
    gap: 1.5rem;
}

.thread-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow);
}

.thread-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 12px 12px 0 0;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.thread-item:hover::before {
    transform: scaleX(1);
}

.thread-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.thread-item h4 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.thread-item h4 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.thread-item h4 a:hover {
    color: var(--primary-color);
}

.thread-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.thread-item .thread-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    flex-wrap: wrap;
}

.thread-item .thread-meta i {
    color: var(--secondary-color);
    margin-right: 0.3rem;
}

/* Leaderboard Page Enhancements */
.leaderboard-page {
    max-width: 900px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    background: var(--surface-color);
    padding: 3rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.page-header h1 i {
    color: #ffd700;
    font-size: 2.2rem;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.leaderboard-list {
    display: grid;
    gap: 1rem;
}

.leaderboard-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow);
}

.leaderboard-item:nth-child(1) {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, var(--surface-color) 100%);
}

.leaderboard-item:nth-child(2) {
    border-color: #c0c0c0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1) 0%, var(--surface-color) 100%);
}

.leaderboard-item:nth-child(3) {
    border-color: #cd7f32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1) 0%, var(--surface-color) 100%);
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
    background: rgba(0, 184, 212, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    color: #c0c0c0;
    background: rgba(192, 192, 192, 0.2);
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    color: #cd7f32;
    background: rgba(205, 127, 50, 0.2);
}

.leaderboard-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.leaderboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.leaderboard-name a:hover {
    color: var(--primary-color);
}

.leaderboard-username {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.leaderboard-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.leaderboard-stats .stat {
    text-align: center;
    background: rgba(0, 184, 212, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 70px;
}

.leaderboard-stats .stat span {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.leaderboard-stats .stat small {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard-stats .total-score {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
}

.leaderboard-stats .total-score span {
    color: white;
}

.leaderboard-stats .total-score small {
    color: rgba(255, 255, 255, 0.9);
}

/* Search Page Enhancements */
.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-form {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.search-box {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    font-family: var(--font-primary);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 184, 212, 0.1);
}

.search-filters {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.search-filters label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-secondary);
}

.search-filters label:hover {
    border-color: var(--primary-color);
    background: rgba(0, 184, 212, 0.05);
}

.search-filters input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.search-filters input[type="radio"]:checked + label,
.search-filters label:has(input[type="radio"]:checked) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.search-results {
    display: grid;
    gap: 1.5rem;
}

.search-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
}

.search-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    opacity: 0.5;
}

.search-result {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
}

.search-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 12px 12px 0 0;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.search-result:hover::before {
    transform: scaleX(1);
}

.search-result:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.search-result h4 {
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.search-result h4 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.search-result h4 a:hover {
    color: var(--primary-color);
}

.search-result p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.search-result-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    flex-wrap: wrap;
}

.result-type {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* Thread Page Enhancements */
.thread-page {
    max-width: 900px;
    margin: 0 auto;
}

.breadcrumb {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.thread-header {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.thread-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.thread-title {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.3;
    font-weight: 600;
}

.thread-info {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.thread-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.thread-info i {
    color: var(--secondary-color);
}

.archived-badge,
.locked-badge {
    background: #f39c12;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.locked-badge {
    background: #e74c3c;
}

.posts {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.post {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.post:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
}

.post-header {
    background: rgba(0, 184, 212, 0.03);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.post-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-info {
    flex: 1;
}

.post-author a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-author a:hover {
    color: var(--primary-color);
}

.post-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.edited {
    font-style: italic;
    opacity: 0.8;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.post-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.post-link:hover {
    background: rgba(0, 184, 212, 0.1);
    color: var(--primary-color);
}

.post-content {
    padding: 1.5rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.post-attachments,
.post-embeds {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.attachment {
    background: rgba(0, 184, 212, 0.05);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.attachment a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    flex: 1;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.embed {
    background: rgba(0, 184, 212, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.embed-image {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}

.thread-navigation {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    background: var(--background-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .threads-grid,
    .channels-grid {
        grid-template-columns: 1fr;
    }
    
    .thread-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .channel-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .leaderboard-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .leaderboard-stats {
        justify-content: center;
    }
    
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .thread-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .post-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .thread-navigation {
        flex-direction: column;
    }
    
    .thread-item .thread-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
