:root {
    --primary-color: #7d5fff;
    --secondary-color: #00d2d3;
    --bg-dark: #0a0b10;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent-glow: 0 0 20px rgba(125, 95, 255, 0.5);
    --glass-bg: rgba(18, 18, 24, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* RTL Fixes */
.ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

.me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* GPU compositing optimization */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Tajawal', system-ui, sans-serif; /* system-ui as fast fallback */
    margin: 0;
    overflow-x: hidden;
}

/* Bootstrap compatibility for dark theme */
.text-muted {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

.text-muted.small,
.small.text-muted {
    color: rgba(255, 255, 255, 0.65) !important;
}

/* Header Styles */
.gaming-header {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 50px;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 1.1rem;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.auth-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-btn {
    background: linear-gradient(135deg, var(--primary-color), #5f27cd);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    will-change: transform;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--accent-glow);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--card-bg);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.username {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Hero Section */
.hero-section {
    padding: 180px 0 100px;
    background: linear-gradient(rgba(10, 11, 16, 0.7), rgba(10, 11, 16, 0.9)), url('../img/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #fff, var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-description {
    font-size: 1.4rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* Services Section */
.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 4px;
    background: var(--primary-color);
    bottom: -10px;
    left: 20%;
    border-radius: 2px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s;
    text-decoration: none;
    color: inherit;
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Partners Section */
.partners-container {
    padding: 4rem 0;
    background: rgba(0, 0, 0, 0.3);
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 220px));
    justify-content: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.partner-item {
    display: block;
    position: relative;
    padding: 1.2rem 0.8rem;
    border-radius: 14px;
    border: 2px solid transparent;
    transition: all 0.3s;
    background: var(--card-bg);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    will-change: transform;
}

.partner-item:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 210, 211, 0.3);
    transform: translateY(-5px);
    text-decoration: none;
    color: inherit;
}

.partner-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.partner-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-border);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.partner-item:hover .partner-img {
    border-color: var(--secondary-color);
    box-shadow: 0 0 12px rgba(0, 210, 211, 0.4);
}

.partner-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}

.partner-badges {
    display: flex;
    gap: 0.3rem;
}

.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-power { background: #e0ac00; color: #000; }
.badge-owner { background: var(--primary-color); color: #fff; }

/* Payment Methods */
.payments-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    padding: 2rem 0;
}

.payment-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    transition: color 0.3s, transform 0.2s;
}

.payment-icon:hover {
    color: var(--text-main);
    transform: scale(1.1);
}

/* Feedback Section */
.feedback-box {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.feedback-form textarea {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    resize: none;
    margin-bottom: 2rem;
}

.feedback-form button {
    width: 100%;
    padding: 1rem;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-content h1 { font-size: 2.2rem; }
    .hero-description { font-size: 1.1rem; }
    .hero-section { padding: 140px 1rem 80px; }
    .gaming-header { padding: 0.8rem 0; }
    .logo-img { height: 40px; }
    .user-profile { padding: 0.2rem 0.6rem; }
    .service-icon { font-size: 2.5rem; }
    .service-card h3 { font-size: 1.3rem; }
}

/* Content visibility: skip rendering off-screen sections */
.partners-container,
#services,
.feedback-box {
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
}

/* Lazy-loaded images: prevent layout shift */
img[loading="lazy"] {
    background-color: rgba(255,255,255,0.04);
}

/* ===== Star Rating Widget ===== */
.star-widget {
    background: rgba(255, 202, 8, 0.04);
    border: 1px solid rgba(255, 202, 8, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.star-widget-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.star-rating-label {
    font-size: 1rem;
    font-weight: 700;
    color: #ffca08;
    min-height: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 0.5rem;
}

.star-rating input {
    display: none;
}

.star-rating label {
    width: 52px;
    height: 52px;
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: color 0.25s ease, transform 0.2s ease, filter 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.star-rating input:checked+label,
.star-rating label:hover,
.star-rating label:hover~label {
    color: #ffca08;
    transform: scale(1.25);
    filter: drop-shadow(0 0 8px rgba(255, 202, 8, 0.6));
}

.star-rating input:checked~label {
    color: #ffca08;
    filter: drop-shadow(0 0 6px rgba(255, 202, 8, 0.4));
}

/* ===== Mobile UI Enhancements ===== */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 11, 16, 0.98);
    backdrop-filter: blur(20px);
    z-index: 2000;
    transform: translateX(100%);
    /* RTL hidden state */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-overlay.active {
    transform: translateX(0);
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(18, 18, 24, 0.85);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0 1.2rem;
    /* Extra padding for iOS home indicator */
    z-index: 999;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 4px;
    transition: color 0.3s, transform 0.2s;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.bottom-nav-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid currentcolor;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
        /* space for bottom nav */
    }
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0px;
    }
}
