:root {
    --bg-primary: #0f1015;
    --bg-secondary: rgba(24, 26, 32, 0.75);
    --bg-card: rgba(33, 36, 45, 0.7);
    --accent-color: #ff3e3e;
    --accent-hover: #e03232;
    --text-main: #f1f1f1;
    --text-muted: #9e9ea7;
    --border-color: rgba(255, 255, 255, 0.1);
    --success-color: #28a745;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('Image/Background.jpg') no-repeat center center/cover;
    filter: blur(10px) brightness(0.35);
    transform: scale(1.05);
    z-index: -1;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.8rem 2rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-main);
    letter-spacing: 1px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(255, 62, 62, 0.5);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-main);
    background-color: var(--bg-card);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background-color: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.user-profile:hover {
    border-color: var(--accent-color);
}

/* VOICE SEARCH BUTTON */
.btn-voice {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-voice:hover,
.btn-voice.listening {
    color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 62, 62, 0.5);
}

.btn-voice.listening {
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.15);
    }
}

/* SWITCH TOGGLE */
.auto-update-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* CONTAINER & LAYOUT */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

.page-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-banner {
    height: 340px;
    background: linear-gradient(180deg, rgba(15, 16, 21, 0.2) 0%, rgba(15, 16, 21, 0.95) 100%), url('https://picsum.photos/1200/400?random=99') center/cover;
    border-radius: var(--border-radius);
    display: flex;
    align-items: flex-end;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.hero-content {
    max-width: 600px;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin: 0.5rem 0;
}

.tag {
    background-color: var(--accent-color);
    color: white;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background-color: var(--bg-secondary);
    backdrop-filter: blur(8px);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(255, 62, 62, 0.2);
}

.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card-price {
    margin-top: auto;
    font-weight: bold;
    color: var(--accent-color);
    font-size: 1.1rem;
}

/* DETAIL PAGE */
.btn-back {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.badge-genre {
    background-color: var(--bg-card);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.media-container {
    margin-bottom: 2rem;
}

.main-media iframe {
    width: 100%;
    height: 450px;
    border-radius: var(--border-radius);
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.specs-table {
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    line-height: 1.8;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 1.5rem;
}

.achievement-card {
    background-color: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.achievement-card i {
    color: gold;
    font-size: 1.2rem;
}

.price-box {
    background-color: var(--bg-secondary);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 90px;
}

.price-display {
    font-size: 1.8rem;
    font-weight: bold;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.comment-form select,
.comment-form textarea,
.input-group input {
    background-color: rgba(15, 16, 21, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    width: 100%;
    outline: none;
    transition: var(--transition);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-item {
    background-color: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
}

.comment-item.bug {
    border-left-color: #ffc107;
}

/* AI WIDGET STYLING */
.ai-toggle-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 62, 62, 0.4);
    z-index: 99;
    transition: var(--transition);
}

.ai-toggle-btn:hover {
    transform: scale(1.1);
}

.ai-widget {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 25px;
    width: 350px;
    height: 450px;
    background: rgba(24, 26, 32, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    flex-direction: column;
    overflow: hidden;
}

.ai-header {
    background: var(--bg-card);
    padding: 1rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.ai-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.ai-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
}

.ai-msg {
    padding: 0.6rem 1rem;
    border-radius: 10px;
    max-width: 85%;
    line-height: 1.4;
    word-break: break-word;
}

.ai-msg.bot {
    background: var(--bg-card);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.ai-msg.user {
    background: var(--accent-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.ai-footer {
    display: flex;
    padding: 0.8rem;
    background: var(--bg-primary);
    gap: 8px;
}

.ai-footer input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    outline: none;
}

.ai-footer button {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
}

/* MODAL & BUTTONS */
.glass-card {
    background: rgba(24, 26, 32, 0.85) !important;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.auth-tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.auth-form.active {
    display: flex;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.margin-top-1 {
    margin-top: 0.8rem;
}

.btn {
    padding: 0.75rem 1.2rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(255, 62, 62, 0.4);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: white;
}

.btn-full {
    width: 100%;
}

.badge {
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-content {
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 420px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: var(--bg-card);
    color: var(--text-main);
    text-align: center;
    border-radius: var(--border-radius);
    padding: 1rem;
    position: fixed;
    z-index: 300;
    bottom: 30px;
    right: 30px;
    border: 1px solid var(--accent-color);
    backdrop-filter: blur(8px);
}

.toast.show {
    visibility: visible;
    animation: slideIn 0.5s, fadeOut 0.5s 2.5s;
}

@keyframes slideIn {
    from {
        right: -300px;
    }

    to {
        right: 30px;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 1rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .main-media iframe {
        height: 240px;
    }

    .hero-banner {
        height: 250px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .ai-widget {
        width: 90%;
        right: 5%;
        bottom: 80px;
    }
}