@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@100;200;300;400;500;600;700;800;900&display=swap');

:root {
    --bg-dark: #050505;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-surface: rgba(20, 20, 20, 0.6);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    --primary: #6366f1;
    --accent: #a855f7;
}

/* Base Setup */
body {
    background-color: var(--bg-dark);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

/* --- Noise Texture (Ultra-Glass Effect) --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* --- Navbar (Glass Island) --- */
/* --- iOS 26 Hyper-Glass --- */
.glass-island {
    background: rgba(15, 15, 20, 0.5);
    /* Lower opacity */
    backdrop-filter: blur(24px) saturate(180%);
    /* Extreme Blur */
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 2rem;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-link {
    padding: 8px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* --- Buttons --- */
.btn-primary {
    position: relative;
    padding: 14px 40px;
    border-radius: 99px;
    background: white;
    color: black;
    font-weight: 800;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.4);
}

.btn-glass {
    padding: 14px 40px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 700;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-glow-sm {
    padding: 8px 20px;
    border-radius: 99px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-glow-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

/* --- Cards & Content --- */
/* --- Ultra-Glass Card --- */
.glass-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(10, 10, 10, 0.4) 100%);
    backdrop-filter: blur(50px) saturate(200%);
    /* Max Blur & Saturation */
    -webkit-backdrop-filter: blur(50px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow:
        0 10px 40px -10px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 60%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Spotlight Gradient using CSS Vars from JS */
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.glass-card:hover::after {
    opacity: 1;
}

.room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    color: #a1a1aa;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.room-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: rgba(255, 255, 255, 0.05);
}

.room-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.2);
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: #818cf8;
    border-radius: 50%;
    box-shadow: 0 0 10px #818cf8;
}

/* --- Rules --- */
.glass-section {
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(40px);
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8);
}

.rule-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.rule-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(-5px);
}

.rule-item span {
    color: #6366f1;
    font-weight: 800;
    font-size: 1.1rem;
    font-family: monospace;
}

.rule-item p {
    color: #d4d4d8;
    font-weight: 300;
    line-height: 1.6;
}

/* --- Role Chips --- */
.role-chip {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    background-color: var(--glass-highlight);
    border: 1px solid transparent;
}

.role-chip:hover {
    transform: scale(1.05) rotate(2deg);
    filter: brightness(1.2);
}

/* --- AI Widget Cleaned --- */
.ai-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.ai-toggle {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease;
}

.ai-toggle:hover {
    transform: translateY(-5px);
    border-color: #6366f1;
}

.ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 500px;
    background: #0f0f11;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.8);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ai-chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 80%;
}

.message.bot {
    background: rgba(255, 255, 255, 0.05);
    color: #d4d4d8;
    align-self: flex-start;
    border-bottom-right-radius: 2px;
}

.message.user {
    background: #4f46e5;
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 2px;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    color: white;
    outline: none;
    transition: 0.3s;
}

.chat-input:focus {
    border-color: #6366f1;
    background: black;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.send-btn:hover {
    background: #4338ca;
}

/* --- Mobile Menu --- */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #6366f1;
    transition: all 0.3s;
    transform: translateX(-50%);
}

.mobile-link:hover::after {
    width: 100%;
}

/* --- Floating Animation --- */
@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes float-delayed {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(20px);
    }
}

.animate-float-slow {
    animation: float-slow 8s infinite ease-in-out;
}

.animate-float-delayed {
    animation: float-delayed 10s infinite ease-in-out;
}