/* ================================================================
   M-GATE STYLESHEET - MAIN GLOBAL
   ================================================================ */

/* ======================= BIẾN VÀ FONT ======================= */
:root {
    --primary-purple: #8f00ff;
    --secondary-blue: #3b82f6;
    --dark-bg: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --input-bg: rgba(255, 255, 255, 0.07);
    --btn-secondary-bg: rgba(255, 255, 255, 0.1);
    --btn-secondary-hover: rgba(255, 255, 255, 0.15);
    --text-light: #f3f4f6;
    --text-muted: #d1d5db;
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient: linear-gradient(90deg, var(--primary-purple), var(--secondary-blue));
    --green: #00cc66;
    --gold: #ffd700;
    --pink: #ff2d95;
}

/* ======================= THIẾT LẬP CHUNG ======================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.6;
}

.container {
    width: 95%;
    max-width: 1800px;
    margin: 0 auto;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--secondary-blue);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--text-light);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    line-height: 1.3;
}

.text-container {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.text-container > p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

.hidden {
    display: none !important;
}

/* ======================= COMPONENTS CHUNG ======================= */

/* --- Logo --- */
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-light);
    text-decoration: none;
}

/* --- Buttons --- */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: var(--text-light);
    background-size: 200% 100%;
}
.btn-primary:hover {
    color: #fff;
    background-position: 100% 0;
    box-shadow: 0 0 15px rgba(143, 0, 255, 0.5);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-muted);
    border: 1px solid transparent;
}
.btn-secondary:hover {
    background: var(--btn-secondary-hover);
    color: var(--text-light);
}

.btn-filter {
    background: var(--btn-secondary-bg);
    color: var(--text-muted);
    border: 1px solid transparent;
}
.btn-filter.active, .btn-filter:hover {
    color: var(--text-light);
    background: var(--primary-purple);
}

.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; font-weight: 500; }

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}
.icon-btn:hover { color: var(--text-light); }

/* --- Animation --- */
.animated-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animated-section.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ======================= LAYOUT CHUNG ======================= */

/* --- Header --- */
.main-header {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.main-nav { display: block; }
.main-nav ul { list-style: none; display: flex; gap: 2rem; }
.main-nav a {
    color: var(--text-muted);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-purple);
    transition: width 0.3s;
}
.main-nav > ul > li > a:not(:only-child)::after {
    display: none; /* Không gạch chân cho link có dropdown */
}
.main-nav a:hover::after { width: 100%; }
.main-nav a:hover, .main-nav a.active { color: var(--text-light); }

/* THÊM MỚI: Style cho link active trên header */
.main-nav a.active::after {
    width: 100%;
}


/* --- Header Dropdown Menu --- */
.main-nav .has-dropdown { position: relative; }
.main-nav .has-dropdown > a { cursor: pointer; }
.main-nav .has-dropdown .fa-chevron-down { font-size: 0.7rem; transition: transform 0.3s ease; }
.main-nav .has-dropdown:hover .fa-chevron-down { transform: rotate(180deg); }

.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 150%; /* Vị trí so với thẻ a */
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    list-style: none;
    min-width: 280px;
    z-index: 1010;
    opacity: 0;
    transition: opacity 0.3s ease, top 0.3s ease;
}
.main-nav .has-dropdown:hover .dropdown-menu { 
    display: block; 
    opacity: 1;
    top: 100%;
}
.main-nav .dropdown-menu li { width: 100%; }
.main-nav .dropdown-menu a { 
    padding: 0.75rem 1rem; 
    white-space: nowrap; 
    width: 100%;
    transition: all 0.2s ease;
}
.main-nav .dropdown-menu a:hover { background-color: var(--primary-purple); }
.main-nav .dropdown-menu a::after { display: none; } /* Bỏ gạch chân trong dropdown */

.header-actions { display: flex; align-items: center; gap: 1.25rem; }
.mobile-menu-toggle { display: none; background: none; border: none; color: var(--text-light); font-size: 1.5rem; cursor: pointer; }

/* Mobile Nav */
.mobile-nav { display: none; flex-direction: column; gap: 1.5rem; background: var(--dark-bg); position: absolute; top: 100%; left: 0; right: 0; padding: 2rem; border-bottom: 1px solid var(--border-color); }
.mobile-nav.active { display: flex; }
.mobile-nav ul { list-style: none; display: flex; flex-direction: column; gap: 1.5rem; text-align: center; }
.mobile-nav a { color: var(--text-light); font-size: 1.1rem; }
/* Dropdown trên mobile */
.mobile-nav .dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-left: 1.5rem; /* Thụt lề cho dễ nhìn */
    margin-top: 1rem;
}
.mobile-nav .dropdown-menu a { font-size: 1rem; color: var(--text-muted); }
.mobile-nav .has-dropdown > a {
    /* [Chưa xác minh] Logic JS sẽ cần để toggle dropdown này trên mobile */
}

/* --- Footer --- */
.main-footer {
    background: #050505;
    padding: 4rem 0 2rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.footer-container { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 3rem; margin-bottom: 3rem; }
.footer-logo { margin-bottom: 1rem; text-align: left; }
.footer-about p { color: var(--text-muted); text-align: left; }
.footer-col { text-align: left; }
.footer-col h4 { margin-bottom: 1.5rem; font-size: 1rem; font-weight: 600; color: var(--text-light); }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--primary-purple); }
.social-icons { display: flex; gap: 1rem; }
.social-icon { color: var(--text-muted); font-size: 1.25rem; }
.social-icon:hover { color: var(--primary-purple); }
.footer-bottom { text-align: center; color: var(--text-muted); border-top: 1px solid var(--border-color); padding-top: 2rem; font-size: 0.9rem; }


/* --- Carousels --- */
.event-carousel-container, .marketplace-hero-carousel { position: relative; }
.event-grid, .seller-grid, .hero-slides {
    display: grid;
    grid-auto-flow: column;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
/* Chrome, Safari, Opera */
.event-grid::-webkit-scrollbar, .seller-grid::-webkit-scrollbar, .hero-slides::-webkit-scrollbar { 
    display: none; 
}
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(10, 10, 10, 0.7);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.carousel-nav-btn:hover { background-color: var(--primary-purple); border-color: var(--primary-purple); }
.prev-btn { left: -22px; }
.next-btn { right: -22px; }

/* ======================= RESPONSIVE CHUNG ======================= */
@media (max-width: 1024px) {
    .main-nav, .header-actions .btn-primary { display: none; }
    .header-actions { gap: 1rem; }
    .mobile-menu-toggle { display: block; }
    .footer-container { grid-template-columns: 1fr 1fr; }
    .footer-about { grid-column: 1 / -1; text-align: center; }
    .footer-about p, .footer-logo { text-align: center; }
}

@media (max-width: 767px) {
    .section-title { font-size: 2rem; margin-bottom: 2rem; }
    .carousel-nav-btn { display: none; }
    .footer-container { grid-template-columns: 1fr; text-align: center; }
    .footer-col { text-align: center; }
    .social-icons { justify-content: center; }
}