@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap');
body { font-family: 'Cairo', sans-serif; }

/* Theme Colors */
:root { --primary: #10b981; --secondary: #3b82f6; }

/* Light Mode Improvements */
:root:not(.dark) body { background-color: #f0f2f5; color: #000000; }
:root:not(.dark) .bg-card { background-color: #ffffff; border-color: #e4e6eb; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
:root:not(.dark) .bg-input { background-color: #f0f2f5; border-color: #ccd0d5; color: #000000; }
:root:not(.dark) .text-inherit { color: #000000; }
:root:not(.dark) .text-gray-300 { color: #374151; }
:root:not(.dark) .text-gray-400 { color: #4b5563; }
:root:not(.dark) .text-gray-500 { color: #6b7280; }
:root:not(.dark) .ip-black { color: #000000 !important; }
:root:not(.dark) #publicChatBox, :root:not(.dark) #adminMessagesBox { background-color: #f0f2f5; }
:root:not(.dark) .msg-text { color: #000000 !important; }
:root:not(.dark) .msg-badge { background-color: #e4e6eb !important; color: #4b5563 !important; }

/* Fix for Stats Cards in Light Mode */
:root:not(.dark) .stats-card { background-color: #ffffff; border-color: #e4e6eb; color: #000000; }
:root:not(.dark) .stats-card h3 { color: #000000; }

/* Dark Mode */
:root.dark body { background-color: #0f1418; color: #f3f4f6; }
:root.dark .bg-card { background-color: #1e272e; border-color: #374151; box-shadow: none; }
:root.dark .bg-input { background-color: #0f1418; border-color: #374151; color: #f3f4f6; }
:root.dark .text-inherit { color: #f3f4f6; }
:root.dark .stats-card { background-color: #1f2937; border-color: #374151; }

/* Animations & Effects */
.page-section { display: block; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Smooth Page Transition */
main {
    animation: fadeIn 0.5s ease-in-out;
}

.admin-glow { text-shadow: 0 0 10px currentColor; font-weight: 900; }
.btn-pulse:active { transform: scale(0.95); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Utilities */
.input-ltr { direction: ltr; text-align: center; }

/* Toast Notifications */
#toast-container { position: fixed; bottom: 20px; left: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: rgba(17, 24, 39, 0.95); backdrop-filter: blur(10px); color: white; padding: 12px 20px; border-radius: 12px; border-right: 4px solid var(--primary); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5); transform: translateX(-100%); transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); display: flex; align-items: center; gap: 12px; font-size: 14px; min-width: 250px; opacity: 0; }
.toast.show { transform: translateX(0); opacity: 1; }

/* Marquee */
.marquee-ticker {
    background-color: #369876; /* Solid color as requested */
    color: white;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    font-weight: bold;
    z-index: 40;
    width: 100%;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.marquee-content {
    display: inline-block;
    padding-left: 100%; /* Start off-screen */
    animation: marquee-animation 15s linear infinite; /* Adjust speed as needed */
}

@keyframes marquee-animation {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}


/* Player Heads Tooltip */
.player-head-wrapper { position: relative; display: inline-block; transition: transform 0.2s; }
.player-head-wrapper:hover { transform: scale(1.2) translateY(-5px); z-index: 10; }
.player-head-wrapper::after { content: attr(data-name); position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%) translateY(10px); background: rgba(0, 0, 0, 0.9); color: white; padding: 4px 8px; border-radius: 6px; font-size: 10px; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.2s; pointer-events: none; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.player-head-wrapper:hover::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* Context Menu */
#contextMenu { position: absolute; z-index: 1000; display: none; min-width: 150px; }

/* Particles Background */
#particles-js { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: -1; opacity: 0.3; pointer-events: none; }

/* Inventory Grid */
.inv-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; padding: 10px; background: #c6c6c6; border: 2px solid #373737; border-radius: 4px; width: fit-content; margin: 0 auto; }
.dark .inv-grid { background: #333; border-color: #555; }
.inv-slot { width: 36px; height: 36px; background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; display: flex; items-center; justify-content: center; position: relative; }
.dark .inv-slot { background: #222; border-color: #111 #444 #444 #111; }
.inv-slot img { width: 32px; height: 32px; image-rendering: pixelated; }
.inv-count { position: absolute; bottom: 0; right: 2px; font-size: 10px; font-weight: bold; color: white; text-shadow: 1px 1px 0 #000; }

/* Mention Popup Fixed */
#mentionPopup { bottom: 50px; left: 0; width: 200px; max-height: 150px; }

/* News Image Grid */
.news-img-grid { display: grid; gap: 8px; margin-top: 16px; border-radius: 12px; overflow: hidden; }
.news-img-grid.cols-1 { grid-template-columns: 1fr; }
.news-img-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.news-img-grid img { width: 100%; height: 200px; object-fit: cover; cursor: pointer; transition: transform 0.3s; }
.news-img-grid img:hover { transform: scale(1.05); }

/* Reply Styles */
.reply-preview {
    background: rgba(0, 0, 0, 0.2);
    border-right: 3px solid var(--primary);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}
.reply-preview .reply-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90%;
}
.reply-preview .reply-user {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 2px;
    display: block;
}
.reply-quote {
    background: rgba(0, 0, 0, 0.1);
    border-right: 3px solid var(--primary);
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #888;
    cursor: pointer;
}
.reply-quote:hover {
    background: rgba(0, 0, 0, 0.15);
}
.reply-quote .reply-user {
    font-weight: bold;
    color: var(--primary);
    margin-left: 4px;
}

/* Swipe to Reply Icon */
.swipe-reply-icon {
    position: absolute;
    right: -40px; /* Start off-screen to the right (since RTL) */
    top: 50%;
    transform: translateY(-50%) scale(0.5);
    opacity: 0;
    width: 32px;
    height: 32px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    pointer-events: none;
    transition: none; /* Controlled by JS */
}
/* Adjust for LTR if needed, but main site is RTL */
html[dir="ltr"] .swipe-reply-icon {
    right: auto;
    left: -40px;
}

/* Mobile Menu Scroll */
#mobileMenu {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Ad Slots */
.ad-slot {
    width: 100%;
    margin: 20px 0;
    text-align: center;
    overflow: hidden;
    border-radius: 8px;
    background-color: rgba(0,0,0,0.05);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dark .ad-slot {
    background-color: rgba(255,255,255,0.05);
}
.ad-label {
    font-size: 10px;
    color: #888;
    margin-bottom: 4px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}
