/* ============================================
   MKAU GAMING - SHARED DESIGN SYSTEM
   Red, Black & White Theme
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-card: #141414;
    --bg-elevated: #1a1a1a;
    --bg-hover: #1e1e1e;
    --red-primary: #e63232;
    --red-dark: #c41a1a;
    --red-light: #ff4d4d;
    --red-soft: #ff6b6b;
    --red-glow: rgba(230, 50, 50, 0.4);
    --red-subtle: rgba(230, 50, 50, 0.08);
    --red-border: rgba(230, 50, 50, 0.3);
    --white: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-faint: rgba(255, 255, 255, 0.35);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --green: #4caf50;
    --orange: #ff9800;
    --yellow: #ffc107;
    --transition: 0.3s ease;
}

/* Light Mode */
body.light-mode {
    --bg-primary: #f2f2f2;
    --bg-card: #ffffff;
    --bg-elevated: #f8f8f8;
    --bg-hover: #eeeeee;
    --text-primary: #111111;
    --text-secondary: rgba(0, 0, 0, 0.8);
    --text-muted: rgba(0, 0, 0, 0.5);
    --text-faint: rgba(0, 0, 0, 0.35);
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --red-subtle: rgba(230, 50, 50, 0.06);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--red-border);
    transition: background var(--transition);
}

body.light-mode .site-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(230, 50, 50, 0.2);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.875rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 3.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--red-primary), var(--red-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: transform var(--transition);
}

.logo:hover {
    transform: scale(1.03);
}

.main-nav {
    display: flex;
    gap: 1.75rem;
}

.main-nav a {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9375rem;
    position: relative;
    padding: 0.25rem 0;
    transition: color var(--transition);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red-primary);
    transition: width var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--red-primary);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all var(--transition);
}

.search-toggle:hover {
    color: var(--red-primary);
    background: var(--red-subtle);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    border-color: var(--red-border);
    background: var(--red-subtle);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.search-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.search-overlay-inner {
    width: 90%;
    max-width: 700px;
    transform: translateY(-20px);
    transition: transform var(--transition);
}

.search-overlay.active .search-overlay-inner {
    transform: translateY(0);
}

.search-overlay input {
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--red-primary);
    border-radius: 15px;
    padding: 1.25rem 1.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
    outline: none;
}

.search-overlay input::placeholder {
    color: var(--text-faint);
}

.search-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color var(--transition);
}

.search-close:hover {
    color: var(--red-primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--red-glow);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--red-border);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--red-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(230, 50, 50, 0.08);
}

.card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, var(--bg-card), transparent);
}

.card-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.85);
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    z-index: 1;
}

.card-content {
    padding: 1.25rem;
}

.card-tag {
    font-size: 0.75rem;
    color: var(--red-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-faint);
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--red-primary), transparent);
    margin-top: 0.5rem;
}

.section-link {
    color: var(--red-primary);
    font-weight: 500;
    transition: color var(--transition);
}

.section-link:hover {
    color: var(--red-light);
}

/* ============================================
   AI CHATBOT POPUP
   ============================================ */
.ai-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--red-glow);
    transition: all var(--transition);
    z-index: 998;
    border: none;
    color: white;
    font-size: 1.75rem;
}

.ai-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(230, 50, 50, 0.5);
}

.ai-fab.open {
    transform: rotate(45deg) scale(1.1);
}

.ai-chat-popup {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    width: 400px;
    height: 550px;
    background: var(--bg-card);
    border: 1px solid var(--red-border);
    border-radius: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.35s ease;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.ai-chat-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.ai-chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-elevated);
}

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.ai-chat-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
}

.ai-chat-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ai-chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-msg {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    animation: msgFadeIn 0.3s ease;
}

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

.ai-msg-bot {
    background: var(--red-subtle);
    border: 1px solid rgba(230, 50, 50, 0.12);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ai-msg-user {
    background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
}

.ai-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-hover);
    border-radius: 25px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition);
}

.ai-chat-input:focus {
    border-color: var(--red-border);
}

.ai-chat-input::placeholder {
    color: var(--text-faint);
}

.ai-chat-send {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
    transition: all var(--transition);
    flex-shrink: 0;
}

.ai-chat-send:hover {
    transform: scale(1.08);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #111111;
    padding: 3rem 2rem;
    border-top: 1px solid rgba(230, 50, 50, 0.2);
    margin-top: 4rem;
    transition: background var(--transition);
}

body.light-mode .site-footer {
    background: #e8e8e8;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--red-primary);
}

.footer-section a {
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
    transition: color var(--transition);
    font-size: 0.9375rem;
}

.footer-section a:hover {
    color: var(--red-primary);
}

.footer-bottom {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-faint);
    font-size: 0.875rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.rating-excellent { color: var(--green); }
.rating-good { color: var(--orange); }
.rating-average { color: var(--yellow); }
.rating-poor { color: var(--red-primary); }

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-chip {
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 25px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-chip:hover,
.filter-chip.active {
    background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
    border-color: transparent;
    color: white;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .container { padding: 2rem 1rem; }
    .section-title { font-size: 1.5rem; }
    .ai-chat-popup { width: calc(100% - 2rem); right: 1rem; bottom: 6rem; }
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
}