/* ============================================
   BASE STYLES & RESET
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-cyan: #00d4ff;
    --accent-cyan-light: #4dd0e1;
    --accent-pink: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --radius-xl: 25px;
    --radius-full: 50px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    color: #fff;
    font-size: clamp(14px, 2vw, 16px);
    line-height: 1.6;
}

/* ============================================
   USER BADGE
   ============================================ */

.user-badge {
    position: fixed;
    top: clamp(10px, 2vw, 20px);
    right: clamp(10px, 2vw, 20px);
    z-index: 999;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: clamp(8px, 1.5vw, 10px) clamp(15px, 3vw, 20px);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.user-badge:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.user-badge:active {
    transform: scale(0.98);
}

#user-badge-text {
    color: white;
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================
   LAYOUT CONTAINER
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(15px, 3vw, 20px);
}

/* ============================================
   HEADER
   ============================================ */

header {
    text-align: center;
    padding: clamp(20px, 5vw, 40px) 0;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(15px, 3vw, 20px);
    position: relative;
}

.logo-image {
    width: clamp(100px, 20vw, 150px);
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.rules-button {
    padding: clamp(8px, 1.5vw, 10px) clamp(15px, 3vw, 20px);
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-xl);
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.rules-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: clamp(1px, 0.3vw, 2px);
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    opacity: 0.9;
    font-style: italic;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   MAIN CONTENT
   ============================================ */

main {
    margin-top: clamp(20px, 5vw, 40px);
}

.hero {
    text-align: center;
    padding: clamp(30px, 8vw, 60px) clamp(15px, 3vw, 20px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    margin-bottom: clamp(20px, 5vw, 40px);
}

.hero h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: clamp(15px, 3vw, 20px);
}

.tagline {
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    margin-bottom: clamp(20px, 4vw, 30px);
    opacity: 0.9;
}

/* ============================================
   FEATURES GRID
   ============================================ */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: clamp(20px, 4vw, 30px);
    padding: clamp(15px, 3vw, 20px) 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    padding: clamp(25px, 5vw, 40px);
    border-radius: var(--radius-lg);
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.icon {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: clamp(15px, 3vw, 20px);
}

.feature-card h3 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    margin-bottom: clamp(10px, 2vw, 15px);
}

.feature-card p {
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    opacity: 0.9;
    margin-bottom: clamp(15px, 3vw, 20px);
}

.feature-button {
    padding: clamp(10px, 2vw, 12px) clamp(20px, 4vw, 30px);
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    background: var(--primary-gradient);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: bold;
}

.feature-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

/* ============================================
   MODAL BASE STYLES
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--dark-bg);
    margin: clamp(2%, 5vh, 5%) auto;
    padding: 0;
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-lg);
    width: clamp(90%, 95vw, 900px);
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.3);
    display: flex;
    flex-direction: column;
}

/* Close Buttons */
.close, .close-connect, .close-play {
    position: absolute;
    top: clamp(10px, 2vw, 15px);
    right: clamp(10px, 2vw, 15px);
    color: #fff;
    background: var(--accent-pink);
    width: clamp(35px, 6vw, 45px);
    height: clamp(35px, 6vw, 45px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(22px, 4vw, 28px);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.close:hover, .close:focus,
.close-connect:hover, .close-connect:focus,
.close-play:hover, .close-play:focus {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}

/* ============================================
   RULES MODAL
   ============================================ */

.rules-content {
    padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem);
    text-align: center;
    overflow-y: auto;
    max-width: 100%;
}

.rules-content h2 {
    color: var(--accent-cyan);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    font-size: clamp(1.3rem, 3vw, 2rem);
}

.rules-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
}

/* ============================================
   MESSAGE BOARD & CHAT CONTAINER
   ============================================ */

.board-container, .chat-container {
    padding: clamp(2rem, 5vw, 3rem) clamp(0.75rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem);
    height: 100%;
    overflow-y: auto;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
}

.board-container h2, .chat-container h2 {
    color: var(--accent-cyan);
    margin-bottom: var(--spacing-xs);
    text-align: center;
    font-size: clamp(1.3rem, 3vw, 2rem);
}

.board-subtitle, .chat-subtitle {
    text-align: center;
    color: #888;
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    font-style: italic;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

/* ============================================
   SEARCH BAR
   ============================================ */

.search-bar {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    align-items: stretch;
    flex-wrap: wrap;
}

#search-input {
    flex: 1;
    min-width: 200px;
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 20px);
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-xl);
    color: #e0e0e0;
    font-family: inherit;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

#search-input::placeholder {
    color: rgba(224, 224, 224, 0.5);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-cyan-light);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

#clear-search-btn {
    padding: clamp(8px, 2vw, 12px) clamp(16px, 3vw, 24px);
    background: rgba(255, 100, 100, 0.2);
    border: 2px solid #ff6464;
    border-radius: var(--radius-lg);
    color: #ff6464;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    white-space: nowrap;
}

#clear-search-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    transform: scale(1.05);
}

/* ============================================
   POST FORM
   ============================================ */

.post-form {
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

#message-input {
    width: 100%;
    min-height: clamp(70px, 15vw, 100px);
    padding: clamp(0.7rem, 2vw, 1rem);
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    color: #e0e0e0;
    font-family: inherit;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    resize: vertical;
}

#message-input:focus {
    outline: none;
    border-color: var(--accent-cyan-light);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

#post-btn {
    align-self: flex-end;
    padding: clamp(10px, 2vw, 12px) clamp(20px, 4vw, 30px);
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-cyan-light) 100%);
    border: none;
    border-radius: var(--radius-xl);
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

#post-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.5);
}

/* ============================================
   MESSAGES CONTAINER
   ============================================ */

.messages-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex: 1;
    overflow-y: auto;
}

.message-card {
    background: rgba(0, 212, 255, 0.1);
    border-left: 4px solid var(--accent-cyan);
    padding: clamp(0.7rem, 2vw, 1rem);
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.message-card:hover {
    background: rgba(0, 212, 255, 0.15);
    transform: translateX(5px);
}

.message-card.hidden {
    display: none;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.message-author {
    color: var(--accent-cyan);
    font-weight: bold;
}

.message-time {
    color: #888;
}

.message-content {
    color: #c0c0c0;
    line-height: 1.5;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.search-highlight {
    background: rgba(255, 255, 0, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
}

/* ============================================
   GROUP CHAT STYLES
   ============================================ */

.group-selector {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    background: rgba(0, 212, 255, 0.05);
    padding: clamp(1rem, 3vw, 1.5rem);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.group-selector label {
    color: var(--accent-cyan);
    font-weight: bold;
    font-size: clamp(1rem, 2vw, 1.1rem);
}

#group-search-input {
    width: 100%;
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 20px);
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-xl);
    color: #e0e0e0;
    font-family: inherit;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

#group-search-input::placeholder {
    color: rgba(224, 224, 224, 0.5);
}

#group-search-input:focus {
    outline: none;
    border-color: var(--accent-cyan-light);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.group-list {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
}

.group-item {
    padding: clamp(10px, 2vw, 12px) clamp(12px, 3vw, 16px);
    margin: 4px 0;
    background: rgba(0, 212, 255, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    color: #e0e0e0;
    border-left: 3px solid transparent;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.group-item:hover {
    background: rgba(0, 212, 255, 0.2);
    border-left-color: var(--accent-cyan);
    transform: translateX(5px);
}

.group-item.active {
    background: rgba(0, 212, 255, 0.3);
    border-left-color: var(--accent-cyan);
    font-weight: bold;
}

.no-groups {
    text-align: center;
    color: #888;
    padding: clamp(1.5rem, 4vw, 2rem);
    font-style: italic;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.group-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

#create-group-btn, #join-group-btn {
    flex: 1;
    min-width: min(150px, 100%);
    padding: clamp(10px, 2vw, 12px) clamp(20px, 4vw, 24px);
    border: none;
    border-radius: var(--radius-xl);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: clamp(0.9rem, 1.5vw, 0.95rem);
}

#create-group-btn {
    background: var(--accent-pink);
}

#create-group-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.5);
}

#join-group-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

#join-group-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.5);
}

.chat-messages {
    height: clamp(200px, 40vh, 300px);
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    padding: clamp(0.75rem, 2vw, 1rem);
    margin-bottom: var(--spacing-sm);
    flex-shrink: 0;
}

.chat-message {
    margin-bottom: var(--spacing-sm);
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    background: rgba(0, 212, 255, 0.1);
    border-radius: var(--radius-sm);
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: clamp(0.75rem, 1.3vw, 0.85rem);
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.chat-message-author {
    color: var(--accent-cyan);
    font-weight: bold;
}

.chat-message-time {
    color: #888;
}

.chat-message-content {
    color: #c0c0c0;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-input-form {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

#chat-input {
    flex: 1;
    min-width: 200px;
    padding: clamp(10px, 2vw, 12px);
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-xl);
    color: #e0e0e0;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

#chat-input:focus {
    outline: none;
    border-color: var(--accent-cyan-light);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

#send-chat-btn {
    padding: clamp(10px, 2vw, 12px) clamp(20px, 4vw, 30px);
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-cyan-light) 100%);
    border: none;
    border-radius: var(--radius-xl);
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    white-space: nowrap;
}

#send-chat-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.5);
}

/* ============================================
   CUSTOM DIALOG
   ============================================ */

.custom-dialog-modal {
    z-index: 10000;
}

.custom-dialog-content {
    max-width: 500px;
    width: clamp(90%, 95vw, 500px);
    margin: clamp(10%, 15vh, 15%) auto;
    padding: 0;
    overflow: visible;
}

.custom-dialog-header {
    background: var(--primary-gradient);
    padding: clamp(1rem, 3vw, 1.5rem);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 2px solid var(--accent-cyan);
}

.custom-dialog-header h3 {
    color: white;
    margin: 0;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    text-align: center;
}

.custom-dialog-body {
    padding: clamp(1.2rem, 4vw, 2rem);
    color: #e0e0e0;
}

.custom-dialog-body p {
    margin: 0 0 var(--spacing-sm) 0;
    line-height: 1.6;
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    text-align: center;
}

.custom-dialog-body input {
    width: 100%;
    padding: clamp(10px, 2vw, 12px);
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-sm);
    color: #e0e0e0;
    font-size: clamp(0.95rem, 1.5vw, 1rem);
    font-family: inherit;
    margin-top: var(--spacing-sm);
}

.custom-dialog-body input:focus {
    outline: none;
    border-color: var(--accent-cyan-light);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.custom-dialog-footer {
    padding: clamp(1rem, 3vw, 1.5rem);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    flex-wrap: wrap;
}

.dialog-btn {
    padding: clamp(10px, 2vw, 12px) clamp(24px, 5vw, 30px);
    border: none;
    border-radius: var(--radius-xl);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: clamp(0.95rem, 1.5vw, 1rem);
    min-width: clamp(80px, 20vw, 100px);
}

.dialog-ok-btn {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-cyan-light) 100%);
    color: #1a1a2e;
}

.dialog-ok-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.5);
}

.dialog-cancel-btn {
    background: rgba(255, 100, 100, 0.2);
    border: 2px solid #ff6464;
    color: #ff6464;
}

.dialog-cancel-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    transform: scale(1.05);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    text-align: center;
    padding: clamp(30px, 6vw, 40px) 0;
    margin-top: clamp(40px, 8vw, 60px);
    opacity: 0.8;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: clamp(8px, 1.5vw, 12px);
    height: clamp(8px, 1.5vw, 12px);
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin: 2px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-cyan-light) 100%);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    transition: all var(--transition-normal);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-cyan-light) 0%, var(--accent-cyan) 100%);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

::-webkit-scrollbar-thumb:active {
    background: var(--primary-gradient);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-cyan) rgba(0, 0, 0, 0.2);
}

.messages-container::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.group-list::-webkit-scrollbar-thumb,
.rules-content::-webkit-scrollbar-thumb,
.board-container::-webkit-scrollbar-thumb,
.chat-container::-webkit-scrollbar-thumb {
    background: var(--accent-pink);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.messages-container::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.group-list::-webkit-scrollbar-thumb:hover,
.rules-content::-webkit-scrollbar-thumb:hover,
.board-container::-webkit-scrollbar-thumb:hover,
.chat-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f5576c 0%, #f093fb 100%);
    box-shadow: 0 0 10px rgba(240, 147, 251, 0.5);
}

::-webkit-scrollbar-corner {
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 768px) {
    .search-bar,
    .chat-input-form {
        flex-direction: column;
    }
    
    #search-input,
    #clear-search-btn,
    #chat-input,
    #send-chat-btn,
    #post-btn {
        width: 100%;
    }
    
    .group-buttons {
        flex-direction: column;
    }
    
    #create-group-btn,
    #join-group-btn {
        width: 100%;
    }
    
    .custom-dialog-footer {
        flex-direction: column;
    }
    
    .dialog-btn {
        width: 100%;
    }
    
    .message-header,
    .chat-message-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 2% auto;
        width: 95%;
    }
    
    .custom-dialog-content {
        margin: 10% auto;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}
