/* --- CSS Variables & Design Tokens --- */
:root {
    /* Colors derived from the generated TCG image */
    --primary-red: #ff2a2a;
    --primary-red-hover: #ff5252;
    --primary-red-glow: rgba(255, 42, 42, 0.4);

    --bg-base: #0a0505;
    /* Deep dark reddish black */
    --bg-surface: #120909;
    --bg-surface-light: #180d0d;
    --bg-card: rgba(255, 255, 255, 0.03);

    --text-primary: #ffffff;
    --text-muted: #a09898;

    --border-color: rgba(255, 42, 42, 0.15);
    --border-hover: rgba(255, 42, 42, 0.4);

    --accent-blue: #4a90e2;
    /* From the purple/blue reflections in the prompt */
    --accent-purple: #9b51e0;

    /* Layout */
    --container-width: 1200px;
    --nav-height: 80px;

    /* Animations */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* --- Resets & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(255, 42, 42, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(155, 81, 224, 0.05) 0%, transparent 50%);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-red);
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.text-glow {
    color: var(--primary-red);
    text-shadow: 0 0 15px var(--primary-red-glow);
    font-weight: 800;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red), #cc0000);
    color: white;
    box-shadow: 0 4px 15px var(--primary-red-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-red-hover), var(--primary-red));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-red-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary-red);
    background: rgba(255, 42, 42, 0.05);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(10, 5, 5, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary-red-glow);
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px var(--primary-red-glow);
    }

    100% {
        box-shadow: 0 0 20px var(--primary-red), 0 0 40px var(--primary-red-glow);
    }
}

.brand-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(to right, #ffffff, #cccccc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 1rem;
    position: relative;
    padding: 8px 0;
}

.nav-links a i {
    margin-right: 6px;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--primary-red);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary-red);
    transition: width var(--transition-normal);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-auth {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-red), #cc0000);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.user-name {
    font-weight: 600;
    color: #e0e0e0;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: 5px;
}

.btn-icon:hover {
    color: var(--primary-red);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero {
    margin-top: var(--nav-height);
    padding: 80px 20px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, rgba(255, 42, 42, 0.05), transparent);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('alt_istanbul_logo.png');
    background-size: cover;
    background-position: center;
    opacity: 0.03;
    filter: blur(8px);
    z-index: -1;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 35px auto;
}

/* --- Layout Grid --- */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    padding-top: 50px;
    padding-bottom: 80px;
}

/* --- Forum Categories --- */
.category-group {
    margin-bottom: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.category-header {
    background: rgba(255, 42, 42, 0.08);
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.category-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-red);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-list {
    display: flex;
    flex-direction: column;
}

.forum-card {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background var(--transition-fast);
}

.forum-card:last-child {
    border-bottom: none;
}

.forum-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.forum-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary-red);
    margin-right: 20px;
    flex-shrink: 0;
}

.small-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.forum-info {
    flex-grow: 1;
}

.forum-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.forum-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.forum-stats {
    display: flex;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: right;
    flex-shrink: 0;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Sidebar Widgets --- */
.widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.widget-header {
    background: rgba(255, 42, 42, 0.08);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Chatbox */
.chatbox-widget .chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--bg-surface-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.chat-msg {
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary-red);
}

.chat-user {
    font-weight: 600;
    color: var(--accent-blue);
    margin-right: 5px;
}

.chat-user.admin {
    color: var(--primary-red);
}

.chat-text {
    color: #e0e0e0;
}

.chat-input-area {
    display: flex;
    padding: 15px;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.chat-input-area input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    color: white;
    font-family: inherit;
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 9, 9, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.login-overlay a {
    color: var(--primary-red);
    margin-left: 5px;
    text-decoration: underline;
    cursor: pointer;
}

.live-indicator {
    background: var(--primary-red);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 800;
    animation: flash 1.5s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Stats Widget */
.stats-content {
    padding: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.95rem;
}

.stat-row i {
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 15px 0;
}

.stat-row.online span {
    color: #10b981;
    /* Green */
}

.stat-row.online i {
    color: #10b981;
}

.online-users-list {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Footer --- */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 50px 0 20px 0;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    height: 50px;
    margin-bottom: 15px;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 400px;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background: var(--primary-red);
    transform: translateY(-3px);
}

.footer-links h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--primary-red);
}

.footer-links ul li {
    margin-bottom: 8px;
}

.footer-links ul li a {
    color: var(--text-muted);
}

.footer-links ul li a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.disclaimer {
    font-size: 0.75rem;
    margin-top: 5px;
    opacity: 0.5;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-auth {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .forum-stats {
        display: none;
        /* Hide stats on mobile for space */
    }
}