/* ==========================================
   CLAN DBGT 2 - Custom Design System (CSS)
   ========================================== */

:root {
    /* Color Palette */
    --bg-primary: #08080d;
    --bg-secondary: #0e0e16;
    --bg-glass: rgba(15, 15, 27, 0.65);
    --bg-glass-hover: rgba(25, 25, 45, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-active: rgba(255, 102, 0, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --orange-primary: #ff5500;
    --orange-hover: #ff7733;
    --orange-glow: rgba(255, 85, 0, 0.4);
    --orange-glow-light: rgba(255, 85, 0, 0.15);
    
    --blue-primary: #0055ff;
    --blue-hover: #3377ff;
    --blue-glow: rgba(0, 85, 255, 0.4);
    --blue-glow-light: rgba(0, 85, 255, 0.15);
    
    --gold-primary: #ffcc00;
    --gold-hover: #ffe066;
    --gold-glow: rgba(255, 204, 0, 0.4);
    --gold-glow-light: rgba(255, 204, 0, 0.15);
    
    --terminal-bg: #050508;
    
    /* Fonts */
    --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 102, 0, 0.2);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--orange-primary);
}

/* Background Artwork Effects */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 80% 20%, rgba(255, 85, 0, 0.08) 0%, transparent 50%),
                      radial-gradient(circle at 10% 80%, rgba(0, 85, 255, 0.08) 0%, transparent 50%),
                      url('assets/bg_energy.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.65;
    z-index: -2;
    pointer-events: none;
}

.glow-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--bg-primary) 90%);
    pointer-events: none;
}

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

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition-normal);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-img {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 8px var(--orange-glow));
    animation: rotateLogo 12s linear infinite;
}

.logo-text {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.orange-text {
    color: var(--orange-primary);
    text-shadow: 0 0 10px var(--orange-glow);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: var(--orange-primary);
    background: var(--orange-glow-light);
    border-color: rgba(255, 85, 0, 0.2);
}

.nav-link.active .nav-icon {
    filter: drop-shadow(0 0 5px var(--orange-primary));
}

.nav-separator {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 24px 0 8px 18px;
}

.external-link:hover {
    color: var(--gold-primary);
    background: var(--gold-glow-light);
    border-color: rgba(255, 204, 0, 0.15);
}

.discord-btn:hover {
    color: #5865F2;
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.25);
}

.discord-icon {
    transition: var(--transition-fast);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
}

.footer-sub {
    color: var(--orange-primary);
    font-weight: 600;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 110;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 1px;
}

.logo-img-sm {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 6px var(--orange-glow));
}

.menu-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon {
    width: 28px;
    height: 28px;
}

/* Main Content Container */
.content-container {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 50px;
    max-width: 1400px;
    position: relative;
    z-index: 10;
    transition: var(--transition-normal);
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.content-section.active {
    display: block;
}

/* Welcome Page: Hero Banner */
.hero-banner {
    position: relative;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, rgba(14, 14, 26, 0.9) 0%, rgba(20, 20, 40, 0.75) 100%);
    border: 1px solid var(--border-glass);
    padding: 60px;
    margin-bottom: 50px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 380px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle at 70% 40%, rgba(255, 85, 0, 0.15) 0%, transparent 60%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.badge {
    display: inline-block;
    background: rgba(255, 85, 0, 0.15);
    border: 1px solid rgba(255, 85, 0, 0.3);
    color: var(--orange-primary);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 24px;
}

.hero-content h1 {
    font-family: var(--font-title);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.orange-glow {
    color: var(--orange-primary);
    text-shadow: 0 0 20px var(--orange-glow), 0 0 40px rgba(255, 85, 0, 0.2);
}

.hero-lead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background: var(--orange-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px var(--orange-glow);
}

.btn-primary:hover {
    background: var(--orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--orange-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Feature Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.feature-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 30px;
    transition: var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.orange-glow-box {
    background: rgba(255, 85, 0, 0.1);
    border: 1px solid rgba(255, 85, 0, 0.25);
    color: var(--orange-primary);
    box-shadow: 0 0 15px var(--orange-glow-light);
}

.blue-glow-box {
    background: rgba(0, 85, 255, 0.1);
    border: 1px solid rgba(0, 85, 255, 0.25);
    color: #3388ff;
    box-shadow: 0 0 15px var(--blue-glow-light);
}

.gold-glow-box {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.25);
    color: var(--gold-primary);
    box-shadow: 0 0 15px var(--gold-glow-light);
}

.feature-card h3 {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Quick Links Page Bottom */
.quick-links-section {
    margin-top: 50px;
}

.quick-links-section h2 {
    font-family: var(--font-title);
    font-size: 1.75rem;
    margin-bottom: 24px;
}

.play-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.play-card {
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.7) 0%, rgba(10, 10, 20, 0.7) 100%);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 35px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.play-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: var(--transition-fast);
}

.byond-card::before {
    background: var(--gold-primary);
}

.discord-card::before {
    background: #5865F2;
}

.play-card:hover {
    transform: translateY(-3px);
    background: var(--bg-glass-hover);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.byond-card:hover {
    border-color: rgba(255, 204, 0, 0.3);
}

.discord-card:hover {
    border-color: rgba(88, 101, 242, 0.3);
}

.play-card h3 {
    font-family: var(--font-title);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.byond-card h3 {
    color: var(--gold-primary);
}

.discord-card h3 {
    color: #8da4ff;
}

.play-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.card-action-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.play-card:hover .card-action-text {
    padding-left: 5px;
}

/* Sections Shared Headers */
.section-header {
    margin-bottom: 40px;
}

.section-header h2 {
    font-family: var(--font-title);
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* News Section Styles */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.news-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-left: 4px solid var(--orange-primary);
    border-radius: var(--border-radius-md);
    padding: 30px;
    transition: var(--transition-normal);
}

.news-card:hover {
    transform: translateX(4px);
    background: var(--bg-glass-hover);
    border-color: rgba(255, 102, 0, 0.3);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.news-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.news-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 20px;
}

.staff-badge {
    background: rgba(0, 85, 255, 0.15);
    border: 1px solid rgba(0, 85, 255, 0.3);
    color: #3388ff;
}

.patch-badge {
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.3);
    color: var(--gold-primary);
}

.news-card h3 {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.news-body p {
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-size: 1rem;
    line-height: 1.7;
}

.news-body p:last-child {
    margin-bottom: 0;
}

.news-body code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: #ff9966;
    font-size: 0.9rem;
}

.news-body a {
    color: var(--orange-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed var(--orange-primary);
    transition: var(--transition-fast);
}

.news-body a:hover {
    color: var(--orange-hover);
    border-bottom-style: solid;
}

/* Updates Section Layout */
.updates-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

.updates-list-sidebar {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 20px 16px;
}

.updates-list-sidebar .sidebar-title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 10px 15px 10px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 15px;
}

.updates-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.update-menu-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 10px;
}

.update-menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.update-menu-item.active {
    background: var(--orange-glow-light);
    color: var(--orange-primary);
    border-left: 3px solid var(--orange-primary);
    padding-left: 11px;
}

/* Update Viewer Terminal */
.update-viewer-card {
    background: var(--terminal-bg);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.viewer-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.active-log-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.viewer-body {
    padding: 30px;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 600px;
}

.empty-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    height: 380px;
    gap: 16px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    opacity: 0.3;
}

.empty-viewer p {
    font-size: 0.95rem;
}

/* Dynamic Updates Parser Styles (Rendered by JS) */
.update-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 16px;
    color: var(--orange-primary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 85, 0, 0.1);
    border-top-color: var(--orange-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.update-log-block {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.update-log-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.log-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 14px;
}

.log-rev {
    background: rgba(255, 204, 0, 0.1);
    color: var(--gold-primary);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 204, 0, 0.2);
}

.log-author {
    color: #3388ff;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.log-author::before {
    content: '👤';
    font-size: 0.8rem;
}

.log-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.log-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    padding-left: 15px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
}

.log-message ul {
    list-style: none;
}

.log-message li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 15px;
}

.log-message li::before {
    content: '•';
    color: var(--orange-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Skeletons */
.menu-skeleton {
    height: 40px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-sm);
    animation: pulse 1.5s infinite ease-in-out;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

@keyframes rotateLogo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .updates-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    body {
        padding-top: var(--header-height);
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content-container {
        margin-left: 0;
        padding: 24px;
    }
    
    .hero-banner {
        padding: 40px;
    }
    
    .hero-content h1 {
        font-size: 2.75rem;
    }
    
    .play-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .hero-banner {
        padding: 30px 20px;
        min-height: auto;
    }

    .hero-content h1 {
        font-size: 2.25rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn {
        width: 100%;
    }
    
    .feature-card {
        padding: 24px;
    }
}
