* {
    scroll-behavior: smooth;
}
html {
    scroll-padding-top: 80px;
}
body {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    position: relative;
    overflow-x: hidden;
}
body.modal-open {
    overflow: hidden;
    height: 100vh;
}
/* Custom select dropdown styling */
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}
select.glass {
    background: rgba(20, 20, 20, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center !important;
    background-size: auto, 16px !important;
    padding-right: 40px !important;
}
/* Fix dropdown option styling */
select option {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    padding: 8px 12px;
}
select option:hover,
select option:focus,
select option:checked {
    background-color: #2a2a2a !important;
    color: #ff9ff3 !important;
}
/* Custom scrollbar for textareas and chat */
.custom-scrollbar::-webkit-scrollbar,
textarea::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
    background: rgba(20, 20, 20, 0.3);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 159, 243, 0.3);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 159, 243, 0.5);
}
/* Auto-expandable textarea */
textarea.auto-expand {
    overflow-y: hidden;
    min-height: 44px;
    max-height: 200px;
    resize: none;
    transition: height 0.1s ease;
}
textarea.auto-expand.expanded {
    overflow-y: auto;
}
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.animated-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(-45deg, #0a0a0a, #1a0a1a, #0a0a1a, #1a0a0a);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    z-index: -2;
}
.animated-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 159, 243, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 111, 179, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 159, 243, 0.05) 0%, transparent 50%);
    animation: gradient-shift 20s ease-in-out infinite reverse;
}
@keyframes float-particles {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}
.particle {
    position: fixed;
    width: 2px;
    height: 2px;
    background: rgba(255, 159, 243, 0.5);
    border-radius: 50%;
    animation: float-particles 20s linear infinite;
}
.glass {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}
.glass:hover {
    background: rgba(25, 25, 25, 0.7);
    border-color: rgba(255, 255, 255, 0.12);
}
.glass-dark {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.text-gradient {
    background: linear-gradient(135deg, #ff9ff3 0%, #ff6fb3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
@keyframes fade-up {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}
.reveal {
    opacity: 0;
    transform: translateY(30px);
}
.reveal.active {
    animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.pulse {
    animation: pulse 2s ease-in-out infinite;
}
.btn-primary {
    background: linear-gradient(135deg, #ff9ff3 0%, #ff6fb3 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}
.btn-primary:hover::before {
    left: 100%;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 159, 243, 0.3);
}
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}
.accordion-content.active {
    max-height: 1500px;
    opacity: 1;
}
.accordion-item {
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}
.accordion-item:hover {
    border-color: rgba(255, 159, 243, 0.2);
}
.accordion-item.active {
    border-color: rgba(255, 159, 243, 0.3);
    background: rgba(255, 159, 243, 0.02);
}
.accordion-trigger {
    transition: all 0.3s ease;
}
.accordion-trigger:hover {
    background: rgba(255, 255, 255, 0.03);
}
.accordion-item.active .accordion-trigger {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}
.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers with address bars */
    background: #0a0a0a;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.modal-backdrop.active .modal-content {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
    }
}
@media (max-width: 768px) {
    .slider-container {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    .slider-container::-webkit-scrollbar {
        display: none;
    }
    .slider-wrapper {
        display: flex;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
    }
    .slider-item {
        flex: 0 0 90%;
        scroll-snap-align: start;
        min-height: auto;
    }
    .slider-wrapper::after {
        content: '';
        flex: 0 0 1rem;
    }
}
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}
@keyframes divider-glow {
    0%, 100% { opacity: 0.3; transform: scaleX(0.8); }
    50% { opacity: 1; transform: scaleX(1); }
}
.section-divider {
    position: relative;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 159, 243, 0.3), transparent);
    margin: 5rem auto;
    overflow: hidden;
}
.section-divider::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, #ff9ff3, transparent);
    animation: divider-glow 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
.float-animation {
    animation: float 3s ease-in-out infinite;
}
.premium-glow {
    box-shadow: 0 0 30px rgba(255, 159, 243, 0.15);
}
.premium-badge {
    background: linear-gradient(135deg, #ff9ff3 0%, #ff6fb3 100%);
    color: #000;
    font-weight: 900;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    letter-spacing: 0.5px;
    display: inline-block;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(255, 159, 243, 0.3);
}
.server-stat {
    white-space: nowrap;
}
@media (max-width: 640px) {
    .server-stat p:last-child {
        font-size: 1rem;
    }
}
.server-address {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
@keyframes count-update {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.count-update {
    animation: count-update 0.3s ease;
}
.elo-gray { color: #9d9d9d; }
.elo-green { color: #1eff00; }
.elo-blue { color: #0070dd; }
.elo-purple { color: #a335ee; }
.elo-orange { color: #ff8000; }
.elo-red { color: #e6675c; }
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner {
    animation: spin 1s linear infinite;
}
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 159, 243, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 159, 243, 0.5);
}
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 159, 243, 0.3) rgba(255, 255, 255, 0.05);
}
.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}
.top-player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
}
.rank-badge {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 8px;
}
.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #808080); color: #000; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #fff; }
[data-lucide] {
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}
[data-lucide="message-square"] {
    width: 1.25rem !important;
    height: 1.25rem !important;
}
.flex.items-center.gap-1 > [data-lucide]:not(:last-child),
.flex.items-center.gap-2 > [data-lucide]:not(:last-child),
.flex.items-center.gap-3 > [data-lucide]:not(:last-child),
.flex.items-center.justify-center.gap-1 > [data-lucide]:not(:last-child),
.flex.items-center.justify-center.gap-2 > [data-lucide]:not(:last-child),
.flex.items-center.justify-center.gap-3 > [data-lucide]:not(:last-child) {
    margin-right: 0.125rem;
}

.steam-login-btn {
    box-shadow: 0 4px 12px rgba(30, 112, 235, 0.3);
    transform: translateY(0);
}

.steam-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 112, 235, 0.4);
}

.steam-login-mobile {
    box-shadow: 0 4px 12px rgba(30, 112, 235, 0.3);
}

.steam-login-mobile:hover {
    box-shadow: 0 6px 20px rgba(30, 112, 235, 0.4);
}

.user-menu-btn {
    border: 1px solid transparent;
}

.user-menu-btn:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

#userMenu.visible {
    transform: translateY(0);
}

#userMenu.invisible {
    transform: translateY(-10px);
}

nav .nav-link {
    letter-spacing: 0.01em;
}

@media (max-width: 640px) {
    .steam-login-btn span {
        display: inline !important;
    }
}

/* Desktop Slider Styles */
.desktop-slider-container {
    position: relative;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 2rem;
    overflow: hidden;
}

.desktop-slider-wrapper {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* Show scrollbar with custom styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 159, 243, 0.3) rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    margin: -0.5rem;
    padding-bottom: 1rem; /* Add space for scrollbar */
}

/* Sleek scrollbar styling */
.desktop-slider-wrapper::-webkit-scrollbar {
    height: 8px;
}

.desktop-slider-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.desktop-slider-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 159, 243, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.desktop-slider-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 159, 243, 0.5);
}

.desktop-slider-item {
    flex: 0 0 calc(50% - 0.75rem);
    scroll-snap-align: start;
    min-width: 0;
}

/* Peek next slide - show 10% of the next card */
@media (min-width: 768px) {
    .desktop-slider-container {
        padding-right: calc(2rem + 5%);
    }
    
    .desktop-slider-wrapper {
        padding-right: 10%;
    }
}

/* Smooth scroll behavior */
.desktop-slider-wrapper {
    scroll-behavior: smooth;
}

/* Active card indicator (optional) */
.desktop-slider-item:first-child {
    scroll-margin-left: 2rem;
}

/* Featured Video Styles with Plyr */
.video-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px 12px 0 0; /* Only round top corners */
    background: #000;
}

.plyr--youtube .plyr__poster {
    background-size: cover;
    background-position: center;
}

.plyr {
    --plyr-color-main: #ff9ff3;
    --plyr-video-control-color: #ffffff;
    --plyr-video-control-background-hover: rgba(255, 159, 243, 0.7);
    --plyr-badge-background: #ff6fb3;
    --plyr-video-progress-buffered-color: rgba(255, 159, 243, 0.25);
}

.plyr--full-ui input[type=range] {
    color: #ff9ff3;
}

.plyr__control--overlaid {
    background: linear-gradient(135deg, #ff9ff3 0%, #ff6fb3 100%);
    color: #000;
}

.plyr__control--overlaid:hover {
    background: linear-gradient(135deg, #ff6fb3 0%, #ff9ff3 100%);
}

/* Server Card Navigation Arrows - Desktop Only */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-nav-prev {
    left: -24px;
}

.slider-nav-next {
    right: -24px;
}

.slider-nav button {
    width: 48px;
    height: 48px;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.slider-nav button:hover {
    background: rgba(255, 159, 243, 0.2);
    border-color: rgba(255, 159, 243, 0.5);
    transform: scale(1.1);
}

.slider-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.slider-nav button:disabled:hover {
    background: rgba(20, 20, 20, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    transform: none;
}

/* Desktop specific */
.desktop-slider-container {
    position: relative;
    overflow: visible !important;
}

.desktop-slider-container .slider-nav {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.desktop-slider-container:hover .slider-nav {
    opacity: 1;
}

/* Parent wrapper needs space for arrows */
.desktop-slider-parent {
    padding: 0 3rem;
    margin: 0 -3rem;
}

/* Hide scrollbar on desktop when using arrows */
.desktop-slider-wrapper.has-arrows {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.desktop-slider-wrapper.has-arrows::-webkit-scrollbar {
    display: none;
}

/* Ticket System Scrollbar Styling */
#messagesContainer,
#modalMessages {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 159, 243, 0.3) rgba(255, 255, 255, 0.05);
}

#messagesContainer::-webkit-scrollbar,
#modalMessages::-webkit-scrollbar {
    width: 6px;
}

#messagesContainer::-webkit-scrollbar-track,
#modalMessages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
}

#messagesContainer::-webkit-scrollbar-thumb,
#modalMessages::-webkit-scrollbar-thumb {
    background: rgba(255, 159, 243, 0.25);
    border-radius: 3px;
}

#messagesContainer::-webkit-scrollbar-thumb:hover,
#modalMessages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 159, 243, 0.4);
}

/* Ticket message styling */
.ticket-message:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Custom scrollbar for ticket containers */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 159, 243, 0.25) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 159, 243, 0.25);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 159, 243, 0.4);
}

/* Fade in animation for messages */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

/* Ticket card hover effect */
.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 159, 243, 0.1);
}

/* ===== Markdown Editor Toolbar ===== */
.markdown-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-bottom: none;
    border-radius: 0.75rem 0.75rem 0 0;
}

.markdown-toolbar .toolbar-divider {
    width: 1px;
    height: 1rem;
    background: rgba(75, 85, 99, 0.5);
    margin: 0 0.25rem;
}

.md-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    color: #9ca3af;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.md-btn:hover {
    color: #ff9ff3;
    background: rgba(255, 159, 243, 0.1);
}

.markdown-toolbar.toolbar-focused {
    border-color: #ff9ff3;
}

/* Admin notes toolbar - yellow theme */
.markdown-toolbar.admin-notes-toolbar {
    border-color: rgb(55, 65, 81); /* gray-700 to match input container */
}

.markdown-toolbar.admin-notes-toolbar.toolbar-focused {
    border-color: #eab308;
}

.md-btn:active {
    transform: scale(0.92);
}

.md-btn svg,
.md-btn i {
    width: 1rem;
    height: 1rem;
}

/* Connect toolbar to textarea below */
.markdown-toolbar + .relative,
.markdown-toolbar + div > textarea,
.markdown-toolbar + textarea {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* ===== Rendered Markdown Content ===== */
.markdown-content {
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.markdown-content p {
    margin: 0;
}

.markdown-content p + p {
    margin-top: 0.5rem;
}

.markdown-content strong {
    font-weight: 600;
    color: #ffffff;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content del {
    text-decoration: line-through;
    opacity: 0.7;
}

.markdown-content code {
    background: rgba(255, 159, 243, 0.1);
    border: 1px solid rgba(255, 159, 243, 0.2);
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85em;
    color: #ff9ff3;
}

.markdown-content pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    overflow-x: auto;
}

.markdown-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #e5e7eb;
    font-size: 0.8125rem;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin: 0.25rem 0;
}

.markdown-content li > ul,
.markdown-content li > ol {
    margin: 0.25rem 0;
}

.markdown-content a {
    color: #ff9ff3;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.markdown-content a:hover {
    color: #ff6fb3;
}

.markdown-content blockquote {
    border-left: 3px solid rgba(255, 159, 243, 0.5);
    padding-left: 1rem;
    margin: 0.5rem 0;
    color: #9ca3af;
    font-style: italic;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid rgba(75, 85, 99, 0.5);
    margin: 1rem 0;
}

/* ===== OpenMoji Emoji Picker ===== */
.emoji-picker-container {
    position: relative;
}

.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 320px;
    max-height: 380px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.75rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    flex-direction: column;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(10px);
}

/* Fixed position variant for pickers appended to body */
.emoji-picker-fixed {
    position: fixed;
    bottom: auto;
    left: auto;
    margin-bottom: 0;
    z-index: 99999; /* Very high to appear above modals */
}

/* Mobile responsive emoji picker */
@media (max-width: 400px) {
    .emoji-picker,
    .emoji-picker-fixed {
        width: calc(100vw - 32px);
        max-width: 320px;
        left: 16px !important;
        right: 16px !important;
    }
}

.emoji-picker.active {
    display: flex;
}

.emoji-picker-search {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.emoji-picker-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.emoji-picker-search input:focus {
    border-color: #ff9ff3;
}

.emoji-picker-search input::placeholder {
    color: #6b7280;
}

.emoji-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.emoji-category-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.25rem 0.25rem;
    margin-top: 0.5rem;
}

.emoji-category-label:first-child {
    margin-top: 0;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
}

.emoji-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0.25rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.emoji-btn:hover {
    background: rgba(255, 159, 243, 0.15);
    transform: scale(1.1);
}

.emoji-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.emoji-no-results {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* OpenMoji inline emoji styling */
.openmoji-emoji {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: -0.35em;
    object-fit: contain;
}

/* ================================
   Ticket Grouping Styles
   ================================ */

/* Ticket being dragged */
.ticket-dragging {
    opacity: 0.6;
    transform: rotate(2deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    cursor: grabbing !important;
}

/* Valid drop target - ungrouped ticket (create new group) */
.ticket-drop-target-create {
    outline: 2px dashed #22c55e !important;
    outline-offset: -2px;
    background: rgba(34, 197, 94, 0.08) !important;
}

/* Valid drop target - grouped ticket (add to existing group) */
.ticket-drop-target-add {
    outline: 2px dashed #a855f7 !important;
    outline-offset: -2px;
    background: rgba(168, 85, 247, 0.08) !important;
}

/* Grouped ticket indicator - subtle left border */
tr.ticket-grouped {
    border-left: 3px solid #a855f7;
}

a.ticket-grouped {
    border-left: 3px solid #a855f7;
}

/* Group child row (for expanded groups - future use) */
.ticket-group-child {
    border-left: 3px solid rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.02);
}

.ticket-group-child td:first-child {
    padding-left: 2rem;
}

/* Draggable row cursor */
tr[draggable="true"] {
    cursor: grab;
}

tr[draggable="true"]:active {
    cursor: grabbing;
}

/* Related Tickets Panel animations */
#relatedTicketsContent {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

#relatedTicketsContent.hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
}

#relatedChevron {
    transition: transform 0.2s ease;
}

/* Group navigation buttons */
#groupNav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Merge confirmation modal animation */
#mergeConfirmModal {
    animation: fadeIn 0.15s ease;
}

#mergeConfirmModal > div {
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   MENTION STYLING (Admin Chat)
   ========================================== */

/* Live mention highlight overlay (behind textarea) */
.mention-highlight-overlay {
    position: absolute;
    inset: 0;
    padding: 10px 48px 10px 12px; /* Match textarea padding */
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.25rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: transparent;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.mention-highlight {
    background: rgba(255, 159, 243, 0.3);
    border-radius: 3px;
    color: transparent;
}

.mention-highlight-everyone {
    background: rgba(250, 204, 21, 0.3);
    border-radius: 3px;
    color: transparent;
}

/* Displayed mention styling (in rendered notes) */
.mention {
    background: rgba(255, 159, 243, 0.2);
    color: #ff9ff3;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.mention-everyone {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
    font-weight: 600;
}