@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #f97316;
    --primary-hover: #fb923c;
    --primary-glow: rgba(249, 115, 22, 0.3);
    --primary-subtle: rgba(249, 115, 22, 0.08);
    --bg-dark: #0a0a0a;
    --bg-card: #111111;
    --bg-elevated: #1a1a1a;
    --bg-header: rgba(10, 10, 10, 0.92);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-main: #f0f0f0;
    --text-muted: #777777;
    --text-dim: #444444;
    --max-width: 1200px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

::selection {
    background: var(--primary);
    color: #000;
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-header);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    height: 64px;
    display: flex;
    justify-content: center;
}

.header-container {
    width: 100%;
    max-width: var(--max-width);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}
.logo-container:hover {
    opacity: 0.85;
}

.header-logo-img {
    height: 36px;
    width: auto;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-bar {
    flex: 1;
    max-width: 320px;
    margin: 0 24px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 9px 16px 9px 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}
.search-bar input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
}
.search-bar input::placeholder {
    color: var(--text-dim);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 0.85rem;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}
.header-auth-loading .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.discord-header-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #5865F2;
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    letter-spacing: 0.3px;
}
.discord-header-btn:hover {
    background: #4752c4;
    transform: translateY(-1px);
}
.discord-header-btn i {
    font-size: 0.95rem;
}

/* Cart button */
.cart-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-size: 0.8rem;
    font-family: inherit;
}
.cart-btn:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

/* User profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.user-profile:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.user-profile .dropdown-arrow {
    font-size: 0.65rem;
    color: var(--text-dim);
    transition: transform 0.3s ease;
}

.user-profile.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-skin-head {
    width: 22px;
    height: 22px;
    border-radius: 4px;
}
.user-nickname {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.85rem;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1001;
    overflow: hidden;
}
.profile-dropdown.show {
    display: block;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-dropdown-header img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
}
.profile-dropdown-header .name {
    font-weight: 600;
    font-size: 0.85rem;
}
.profile-dropdown-header .email {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-size: 0.85rem;
    font-family: inherit;
}
.profile-dropdown-item:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}
.profile-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}
.profile-dropdown-item.logout {
    color: #ef4444;
    border-top: 1px solid var(--border);
}
.profile-dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Menu Toggle */
.menu-toggle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.15rem;
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-toggle:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

/* Sidebar */
.side-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 3000;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.6);
}
.side-menu.active {
    right: 0;
}

.side-menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.side-menu-header h2 {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1px;
}
.side-menu-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}
.side-menu-close:hover {
    color: var(--text-main);
}

.side-menu-links {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.side-link i {
    width: 18px;
    color: var(--primary);
    text-align: center;
    font-size: 0.95rem;
}
.side-link:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 2999;
    display: none;
}
.menu-overlay.active {
    display: block;
}

/* Hero Section */
.hero {
    margin-top: 64px;
    width: 100%;
    height: 380px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.banner-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.35) saturate(1.1);
}

.hero-logo-wrapper {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-logo-img {
    width: 200px;
    max-width: 70vw;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.9));
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px;
}

.main-title {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--primary);
}

/* Forum Grid */
.forum-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
}

.posts-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.blog-post {
    padding: 28px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}
.blog-post:last-child {
    border-bottom: none;
}
.blog-post:hover {
    background: rgba(255, 255, 255, 0.01);
}

.post-image {
    width: 100%;
    aspect-ratio: 16 / 7;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}
.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.blog-post:hover .post-image img {
    transform: scale(1.03);
}

.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}
.btn-read-more:hover {
    gap: 10px;
    opacity: 0.85;
}

/* Widgets */
.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
}

.widget-header {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.widget-content {
    padding: 18px;
}

.btn-sidebar {
    width: 100%;
    padding: 10px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.82rem;
}
.btn-sidebar:hover {
    background: var(--primary-hover);
}

/* Modals */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-overlay.active {
    display: flex;
}

.auth-modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.auth-modal-header {
    margin-bottom: 24px;
    text-align: center;
}
.auth-modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.auth-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}
.auth-close:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}
.form-group select {
    cursor: pointer;
}
.form-group select option {
    background: var(--bg-elevated);
    color: var(--text-main);
}

.auth-submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.auth-submit-btn:hover {
    background: var(--primary-hover);
}
.auth-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 2001;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.cart-modal.active {
    right: 0;
}

/* Footer */
footer {
    background: #050505;
    padding: 48px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-logo-img {
    height: 44px;
    width: auto;
    margin-bottom: 14px;
    opacity: 0.8;
}

.footer-title {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.footer-description {
    max-width: 500px;
    margin: 0 auto 20px;
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Notifications */
.site-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
}

.site-notification.success {
    background: rgba(34, 197, 94, 0.95);
    border: 1px solid #22c55e;
}
.site-notification.error {
    background: rgba(239, 68, 68, 0.95);
    border: 1px solid #ef4444;
}
.site-notification.info {
    background: rgba(59, 130, 246, 0.95);
    border: 1px solid #3b82f6;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Category Items */
.category-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}
.category-item:hover {
    color: var(--primary);
}

/* Post Title */
.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Section Header */
.section-header {
    margin-bottom: 24px;
}
.section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header h2 i {
    color: var(--primary);
}
.section-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Discord OAuth Button */
.discord-login-btn {
    background: #5865F2;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}
.discord-login-btn:hover {
    background: #4752c4;
}

/* Side Search */
.side-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.side-search-box i {
    color: var(--text-dim);
    font-size: 0.85rem;
}
.side-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
}
.side-search-box input::placeholder {
    color: var(--text-dim);
}

.mobile-search-results {
    display: none;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 10px;
}
.mobile-search-results.show {
    display: block;
}

.mobile-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.mobile-search-item:hover {
    background: var(--primary-subtle);
}
.mobile-search-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
.mobile-search-info {
    flex: 1;
}
.mobile-search-name {
    font-weight: 600;
    font-size: 0.85rem;
}
.mobile-search-rank {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }
    .search-bar {
        display: none;
    }
    .hero {
        height: 240px;
    }
    .hero-logo-img {
        width: 140px;
    }
    .forum-grid {
        grid-template-columns: 1fr;
    }
    .main-title {
        font-size: 1.5rem;
    }
    .container {
        padding: 32px 16px;
    }
    .auth-modal {
        padding: 24px;
    }
    .brand-name {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .header-buttons {
        gap: 6px;
    }
    .login-btn, .register-btn {
        padding: 7px 12px;
        font-size: 0.75rem;
    }
    .brand-name {
        display: none;
    }
    .hero {
        height: 200px;
    }
    .hero-logo-img {
        width: 120px;
    }
}
