@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;400;500;700;900&display=swap');

:root {
    --primary-color: #6464ff;
    /* iOS Titanium Gray */
    --accent-color: #ff3b30;
    --bg-color: #000000;
    --glass-bg: rgba(30, 30, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
    --text-secondary: #a0a0a0;
    --card-radius: 24px;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 123, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 59, 48, 0.05) 0%, transparent 20%);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    /* For Arabic */
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-5px);
    background: rgba(40, 40, 40, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Header & Nav */
/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 5%;
    display: flex;
    justify-content: center;
    /* Center the nav */
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    position: absolute;
    right: 5%;
    /* Position logo to the right (RTL start) */
    top: 50%;
    transform: translateY(-50%);
}

.logo-img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

nav a:hover,
nav a.active {
    color: #fff;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    /* RTL */
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: var(--transition);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 80vh;
    /* Reduced height to show content sooner */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 20px 20px;
    position: relative;
    overflow: hidden;
    /* Banner Background */
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8)), url('assets/banner.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax effect */
    box-shadow: inset 0 -100px 100px -50px #000;
    /* Fade to black at bottom */
}

.hero-content {
    max-width: 800px;
    z-index: 2;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 1s ease-out;
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    animation: fadeInUp 1.2s ease-out;
}

.cta-btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--primary-color), #5e5e63);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    animation: fadeInUp 1.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.2);
}

/* Sections */
section {
    padding: 100px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title span {
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Vertical Rules Timeline Layout */
.rules-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

/* The vertical line */
.rules-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 50px;
    /* Adjust for RTL */
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.rule-row {
    position: relative;
    padding-right: 80px;
    /* Space for marker */
    margin-bottom: 30px;
}

.rule-marker {
    position: absolute;
    top: 0;
    right: 32px;
    /* Center on line */
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    color: var(--primary-color);
    z-index: 2;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
    transition: var(--transition);
}

.rule-row:hover .rule-marker {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
}

.rule-content-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: var(--transition);
}

/* Branch connector */
.rule-content-box::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -14px;
    width: 14px;
    height: 2px;
    background: var(--primary-color);
}

.rule-content-box:hover {
    transform: translateX(-5px);
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Accordion for specific sections */
.accordion {
    gap: 15px;
    display: flex;
    flex-direction: column;
}

.accordion-item {
    background: var(--glass-bg);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: var(--transition);
}

.accordion-header {
    padding: 20px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-body {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    color: var(--text-secondary);
}

.accordion-item.active .accordion-body {
    padding-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
    /* Allow scroll if content is long */
}

/* Penalties Step */
.steps-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.step-card {
    flex: 1;
    min-width: 250px;
    text-align: center;
    position: relative;
}

.step-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.step-title {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Safe Zones */
.zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.zone-item {
    text-align: center;
    padding: 2rem;
    font-weight: 700;
    background: rgba(0, 255, 123, 0.05);
    border-color: rgba(0, 255, 123, 0.2);
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-secondary);
    margin-top: 5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dev-credit {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: bold;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: 0.8s all ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .rules-timeline::before {
        right: 20px;
    }

    .rule-marker {
        right: 2px;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .rule-row {
        padding-right: 50px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    nav {
        display: none;
    }

    /* Simplified for mobile, would need JS burger */
    header {
        justify-content: center;
    }
}

/* Server Status Widget */
.server-status-card {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(40, 40, 40, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--card-radius);
    margin-top: 2rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1.6s ease-out;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.status-label {
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.status-badge.online {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.status-badge.offline {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.players-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ccc;
    font-size: 0.95rem;
}

.player-count-value {
    color: var(--primary-color);
    font-weight: 900;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.2rem;
}

/* Penalties Flow Design */
.penalty-flow {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    padding: 2rem 0;
}

.penalty-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    border-right: 4px solid var(--text-secondary);
    padding: 25px;
    border-radius: 16px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-right-width: 4px;
    /* Restore right border */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.penalty-card:hover {
    transform: translateX(-10px);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
}

.penalty-card.warning {
    border-right-color: #ffcc00;
}

.penalty-card.ban-1 {
    border-right-color: #ff6600;
}

.penalty-card.ban-2 {
    border-right-color: #ff3b30;
}

.penalty-card.perma {
    border-right-color: #8b0000;
}

.penalty-icon-box {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.penalty-info h3 {
    margin-bottom: 8px;
    color: #fff;
    font-size: 1.3rem;
}

.penalty-info p {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.5;
}

.exception-box {
    margin-top: 3rem;
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.2);
    padding: 2rem;
    border-radius: 16px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Tabbed Rules Layout */
.rules-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 12px 35px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    font-size: 1.1rem;
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
}

.rules-content-section {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.rules-content-section.active {
    display: block;
}

/* Refined Rule Cards */
.rule-card-modern {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Stronger border */
    margin-bottom: 25px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.rule-card-header {
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-list {
    padding: 10px 0;
}

.rule-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.rule-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.rule-item:last-child {
    border-bottom: none;
}

.rule-number {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: monospace;
    min-width: 45px;
    text-align: center;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-text {
    flex: 1;
    color: #e0e0e0;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Pages Choice Bg Override */
body.vision-page,
body.rules-page,
body.penalties-page,
body.ai-page {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9)), url('assets/banner.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* iOS Style Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 100;
}

.search-wrapper {
    background: rgba(30, 30, 30, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.search-wrapper:focus-within {
    background: rgba(50, 50, 50, 0.6);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.search-results {
    position: absolute;
    top: 60px;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0;
    display: none;
    /* Hidden by default */
    z-index: 101;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-match-text {
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.search-match-loc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Highlight Animation */
@keyframes highlightRule {
    0% {
        background: rgba(255, 204, 0, 0.1);
        transform: scale(1);
    }

    50% {
        background: rgba(255, 204, 0, 0.3);
        transform: scale(1.02);
    }

    100% {
        background: transparent;
        transform: scale(1);
    }
}

.rule-highlight {
    animation: highlightRule 2s ease-out;
}

/* AI Chat Interface */
.chat-container {
    width: 90%;
    max-width: 800px;
    height: 70vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
}

.status-text {
    font-size: 0.85rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.1);
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    animation: fadeInUp 0.3s ease-out;
}

.user-message {
    align-self: flex-end;
    background: var(--primary-color);
    color: #fff;
    border-bottom-left-radius: 4px;
    /* iOS style */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.bot-message {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    /* Glassy gray */
    color: #eee;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.message-content ul {
    margin: 10px 20px 0 0;
    padding-right: 15px;
}

.message-content li {
    margin-bottom: 5px;
}

.chat-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.chat-input-area input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.chat-input-area button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-area button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--primary-color);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    width: fit-content;
    align-self: flex-start;
    margin-bottom: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}