@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --secondary: #ec4899;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Particles Background */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    display: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    animation: slideUp 0.6s ease;
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    width: auto;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-link a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* Chat Page Layout */
.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr auto;
    height: 100vh;
    height: 100dvh;
    position: relative;
    z-index: 1;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}
.sidebar-close:hover {
    background: rgba(255,255,255,0.2);
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    transition: var(--transition);
    position: relative;
}

.user-profile:hover {
    background: var(--bg-card-hover);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.user-avatar-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}

.user-profile { cursor: pointer; }

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info h4 {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-gear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    line-height: 1;
    flex-shrink: 0;
}
.profile-gear:hover {
    color: var(--text);
    background: var(--bg);
}

.user-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    animation: pulse 2s infinite;
}

.sidebar-section {
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
}

.sidebar-rooms {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
}
.sidebar-rooms .room-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: left;
}
.sidebar-rooms .room-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.sidebar-rooms .room-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.sidebar-rooms .room-tab .room-badge {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(239,68,68,0.3);
    color: #ef4444;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: auto;
}
.sidebar-rooms .room-tab.active .room-badge {
    background: rgba(255,255,255,0.2);
    color: white;
}
.sidebar-rooms .room-tab-emoji {
    font-size: 18px;
}

.online-users {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    cursor: default;
    font-size: 13px;
}

.online-user:hover {
    background: var(--bg-card);
}

.online-user .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}

.online-user.offline {
    opacity: 0.55;
}

.online-user .dot.offline {
    background: #6b7280;
}

.sidebar-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.sidebar-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sidebar-btn.logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Main Chat Area */
.chat-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    gap: 16px;
    flex-wrap: wrap;
}

.clock-date {
    display: flex;
    align-items: center;
    gap: 16px;
}

.clock {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.date {
    font-size: 13px;
    color: var(--text-secondary);
}

.weather {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    position: relative;
}

.weather:hover {
    background: var(--bg-card);
}

.weather-temp {
    font-size: 16px;
    font-weight: 700;
}

.weather-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.weather-city {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.weather-city .edit-icon {
    font-size: 10px;
    opacity: 0;
    transition: var(--transition);
}

.weather:hover .edit-icon {
    opacity: 1;
}

.weather-loading {
    font-size: 13px;
    color: var(--text-muted);
}

/* City Edit Modal */
.city-edit-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.city-edit-input input {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: white;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.city-edit-input input:focus {
    border-color: var(--primary);
}

.city-edit-input button {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-xs);
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
}

.city-edit-input button:hover {
    background: var(--primary-dark);
}

/* Profile Modal */
.profile-avatar-wrap {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    flex-shrink: 0;
}
.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-avatar-letter {
    font-size: 36px;
    font-weight: 700;
    color: white;
}
.profile-avatar-emoji {
    font-size: 44px;
    line-height: 1;
}

.user-avatar-emoji {
    font-size: 22px;
    background: transparent;
    line-height: 1;
}

.message-avatar-emoji {
    font-size: 20px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.emoji-avatar-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
    width: 100%;
    padding: 4px 0;
}

.emoji-avatar-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.emoji-avatar-item:hover {
    background: rgba(255,255,255,0.1);
}

.emoji-avatar-item.active {
    background: var(--primary);
    transform: scale(1.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: messageSlide 0.3s ease;
    position: relative;
    group: true;
}

.message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar,
.message-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.message-avatar-img {
    object-fit: cover;
}

.message-body {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px 16px;
    min-width: 60px;
    position: relative;
}

.message.own .message-body {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.3);
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.message-username {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-light);
}

.message.own .message-username {
    color: var(--secondary);
}

.message-time {
    font-size: 10px;
    color: var(--text-muted);
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.message-text img.emoji {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    display: inline;
    animation: emojiBounce 0.3s ease;
}

.message-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xs);
    margin-top: 6px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.message-file:hover {
    background: rgba(255, 255, 255, 0.1);
}

.message-file .file-icon {
    font-size: 24px;
}

.message-file .file-info {
    flex: 1;
    min-width: 0;
}

.message-file .file-info span {
    display: block;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-file .file-info small {
    font-size: 11px;
    color: var(--text-muted);
}

.message-image {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
}

.message-image:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.message-video {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.message-audio {
    width: 100%;
    max-width: 320px;
    height: 44px;
    margin-top: 4px;
    border-radius: var(--radius-sm);
}

.message-actions {
    position: absolute;
    right: 8px;
    top: -8px;
    display: none;
    gap: 8px;
    z-index: 2;
}

.message:hover .message-actions,
.message-actions:hover {
    display: flex;
}

.message-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-action-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* System Message */
.system-message {
    text-align: center;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.system-message span {
    background: var(--bg-card);
    padding: 4px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

/* Chat Input */
.chat-input-area {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 12px;
    transition: var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.chat-input-wrapper textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    padding: 4px 0;
    line-height: 1.5;
}

.chat-input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.input-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.input-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.input-btn.send-btn {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: white;
    width: 40px;
    height: 40px;
}

.input-btn.send-btn:hover {
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    transform: scale(1.05);
}

.gif-btn .gif-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 5px;
    border-radius: 4px;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: #fff;
    line-height: 1.2;
    transition: var(--transition);
}

.gif-btn:hover .gif-label {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: rgba(15, 12, 41, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px;
    width: 360px;
    display: none;
    z-index: 100;
    box-shadow: var(--shadow);
}

.emoji-picker.active {
    display: block;
    animation: slideUp 0.2s ease;
}

.emoji-picker-header {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.emoji-tab {
    padding: 4px 12px;
    border-radius: 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.emoji-tab.active {
    background: var(--primary);
    color: white;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 280px;
    overflow-y: auto;
}

.emoji-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    border: none;
    background: none;
}

.emoji-item:hover {
    background: var(--bg-card-hover);
    transform: scale(1.2);
}

.emoji-item img {
    width: 28px;
    height: 28px;
}

.emoji-grid.anim-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 200px;
}
.emoji-item.gif-emoji {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}
.emoji-item.gif-emoji img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.emoji-item.gif-emoji:hover {
    transform: scale(1.05);
}

/* GIF Picker */
.gif-picker {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: rgba(15, 12, 41, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px;
    width: 380px;
    display: none;
    z-index: 100;
    box-shadow: var(--shadow);
}

.gif-picker .emoji-picker-header {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    gap: 4px;
}

.gif-picker .emoji-picker-header::-webkit-scrollbar {
    height: 3px;
}

.gif-picker .emoji-picker-header::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.gif-picker.active {
    display: block;
    animation: slideUp 0.2s ease;
}

.gif-search {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.gif-search input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: white;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.gif-search input:focus {
    border-color: var(--primary);
}

.gif-search button {
    padding: 8px 12px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-xs);
    color: white;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.gif-search button:hover {
    background: var(--primary-dark);
}

.gif-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}

.gif-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-xs);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    padding: 0;
    background: none;
}

.gif-item:hover {
    transform: scale(1.05);
}

.gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Settings Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: rgba(15, 12, 41, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: white;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--primary);
}

.color-option input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.color-picker-custom {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.color-picker-custom:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.color-picker-custom input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.bg-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.bg-option {
    aspect-ratio: 16/9;
    border-radius: var(--radius-xs);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    background-size: cover;
    background-position: center;
    position: relative;
}

.bg-option:hover {
    transform: scale(1.05);
}

.bg-option.active {
    border-color: white;
}

.bg-option .bg-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px;
    font-size: 9px;
    background: rgba(0, 0, 0, 0.7);
    text-align: center;
    border-radius: 0 0 4px 4px;
}

.bg-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.bg-upload-area:hover {
    border-color: var(--primary);
    background: var(--bg-card);
}

.bg-upload-area input {
    display: none;
}

.bg-upload-area p {
    font-size: 13px;
    margin-bottom: 0;
}

/* Notification Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: rgba(15, 12, 41, 0.98);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    display: none;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow);
    max-width: 360px;
}

.toast.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.5);
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.5);
}

.toast.notif {
    border-color: rgba(167, 139, 250, 0.5);
    background: rgba(167, 139, 250, 0.15);
}

/* Image Viewer Modal */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}

.image-viewer.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

/* Paste Preview Overlay */
.paste-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.paste-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.paste-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.paste-preview img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: var(--radius);
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.paste-preview-footer {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--border-color);
}
.paste-caption-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.paste-caption-row input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.paste-caption-row input:focus { border-color: var(--primary); }
.paste-caption-row input::placeholder { color: var(--text-muted); }
.paste-emoji-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: var(--transition);
}
.paste-emoji-btn:hover { background: var(--bg); }
.paste-emoji-grid {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 80px;
    overflow-y: auto;
    padding: 6px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.paste-emoji-grid.active { display: flex; }
.paste-emoji-item {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    transition: var(--transition);
    line-height: 1;
}
.paste-emoji-item:hover { background: var(--bg-card); }
.paste-preview-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}
.btn-cancel:hover { background: var(--bg); color: var(--text); }
.btn-send {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}
.btn-send:hover { opacity: 0.9; }

.image-viewer img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: var(--radius);
    object-fit: contain;
    transition: transform 0.15s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.image-viewer-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    pointer-events: none;
}

/* Loading */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 12px;
    width: fit-content;
    margin: 4px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* File Preview */
.file-preview {
    display: none;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
}

.file-preview.show {
    display: flex;
}

.file-preview img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    object-fit: cover;
}

.file-preview .file-preview-info {
    flex: 1;
    font-size: 13px;
    min-width: 0;
}

.file-preview .file-preview-info span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview .file-preview-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
    padding: 4px;
}

.file-preview .file-preview-remove:hover {
    color: #ef4444;
}

.file-caption-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text);
    font-size: 12px;
    padding: 2px 0;
    width: 100%;
    outline: none;
    margin-top: 4px;
}
.file-caption-input::placeholder { color: var(--text-muted); }

/* Message Caption */
.message-caption {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.3;
}

/* Admin Badge */
.admin-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-radius: 4px;
    color: white;
    text-transform: uppercase;
    margin-left: 4px;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes emojiBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Users Sidebar */
.users-sidebar {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px solid var(--border-color);
    width: 220px;
    flex-shrink: 0;
    overflow-y: auto;
}
.users-sidebar-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 900px) {
    .chat-layout {
        grid-template-columns: 1fr;
        height: 100dvh;
    }
    .users-sidebar { display: none; }
    .pm-panel { right: 10px; top: auto; bottom: 0; transform: none; height: 70vh; border-radius: 16px 16px 0 0; }
    .sidebar {
        display: none;
    }
    .sidebar.mobile-open {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100dvh;
        z-index: 500;
    }
    .sidebar.mobile-open .sidebar-close {
        display: flex;
    }
    .top-bar {
        padding: 10px 16px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
    }
    .chat-messages {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .message {
        max-width: 90%;
    }
    .chat-input-area {
        padding: 8px 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .chat-input-wrapper {
        padding: 4px 8px;
    }
    .input-actions {
        gap: 2px;
    }
    .input-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .chat-input-wrapper textarea {
        font-size: 16px;
    }
    .clock { font-size: 15px; }
    .date { display: none; }
    .modal { padding: 20px; margin: 10px; }
    .emoji-picker { right: 0; bottom: 100%; }
    .gif-picker { right: 0; bottom: 100%; }
    .weather-temp { font-size: 13px; }
    .weather-desc { font-size: 10px; }
}

@media (max-width: 480px) {
    .auth-card { padding: 24px; }
    .message { max-width: 95%; }
    .message-image { max-width: 200px; }
    .message-video { max-width: 240px; }
    .emoji-picker { width: 280px; right: -40px; }
    .gif-picker { width: 300px; right: -20px; }
    .emoji-picker { width: calc(100vw - 20px); right: 0; }
    .gif-picker { width: calc(100vw - 20px); right: 0; }
}

/* Reply bar above input */
.reply-preview {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
}
.reply-preview.show { display: flex; }
.reply-preview .reply-username {
    font-weight: 700;
    color: var(--primary-light);
    white-space: nowrap;
}
.reply-preview .reply-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}
.reply-preview .reply-cancel {
    cursor: pointer;
    opacity: 0.6;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
}
.reply-preview .reply-cancel:hover { opacity: 1; }

/* Reply embed inside message */
.reply-embed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.05);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-xs);
    font-size: 12px;
    cursor: pointer;
}
.reply-embed .reply-embed-icon {
    font-size: 14px;
    opacity: 0.6;
}
.reply-embed .reply-embed-body {
    flex: 1;
    overflow: hidden;
}
.reply-embed .reply-embed-user {
    font-weight: 700;
    color: var(--primary-light);
    font-size: 11px;
}
.reply-embed .reply-embed-text {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reply-embed .reply-embed-file {
    color: var(--text-muted);
    font-size: 11px;
}

/* Reactions row */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.reaction-chip:hover {
    background: rgba(255,255,255,0.12);
}
.reaction-chip.active {
    background: rgba(124, 58, 237, 0.25);
    border-color: rgba(124, 58, 237, 0.4);
}
.reaction-chip .reaction-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Reaction emoji popover */
.reaction-popover {
    position: absolute;
    right: 0;
    top: -8px;
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    gap: 2px;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.reaction-popover.show { display: flex; }
.reaction-popover .rp-emoji {
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: var(--transition);
    line-height: 1;
}
.reaction-popover .rp-emoji:hover {
    background: rgba(124, 58, 237, 0.2);
    transform: scale(1.2);
}

/* Private Message Panel */
.pm-panel {
    position: fixed;
    top: 50%;
    right: 260px;
    transform: translateY(-50%);
    width: 340px;
    height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    z-index: 200;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.4);
    overflow: hidden;
}
.pm-panel.active { display: flex; }

.pm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(124, 58, 237, 0.15);
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.pm-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
}
.pm-close:hover { color: #ef4444; }

.pm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pm-messages .message {
    max-width: 90%;
    animation: messageSlide 0.2s ease;
}
.pm-messages .message .message-body {
    padding: 8px 12px;
    font-size: 13px;
}

.pm-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
.pm-input-area textarea {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    resize: none;
    outline: none;
    min-height: 36px;
    max-height: 80px;
}
.pm-input-area textarea:focus {
    border-color: var(--primary);
}
.pm-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: white;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.pm-send:hover {
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    transform: scale(1.05);
}

.pm-btn { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px 4px; opacity: 0.5; transition: var(--transition); line-height: 1; margin-left: auto; }
.pm-btn:hover { opacity: 1; transform: scale(1.15); }

/* Unread PM badge */
.pm-unread {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Name emoji */
.name-emoji {
    font-size: 14px;
    margin-right: 3px;
    display: inline;
}
.name-emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    max-height: 120px;
    overflow-y: auto;
    padding: 4px 0;
    margin-top: 4px;
}
.name-emoji-grid .emoji-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: transparent;
}
.name-emoji-grid .emoji-item:hover { background: rgba(255,255,255,0.1); }
.name-emoji-grid .emoji-item.active { background: var(--primary); transform: scale(1.1); }

.online-user-emoji { font-size: 16px; line-height: 1; flex-shrink: 0; }

/* Recording Bar */
.recording-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    margin-top: 8px;
    font-size: 13px;
}
.recording-bar.show { display: flex; }

.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulseRecord 1s ease-in-out infinite;
}
@keyframes pulseRecord {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.recording-timer {
    font-family: monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 36px;
}
.recording-label {
    flex: 1;
    color: var(--text-secondary);
    font-size: 12px;
}
.recording-cancel,
.recording-stop {
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.recording-cancel {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}
.recording-cancel:hover { background: #ef4444; color: white; }
.recording-stop {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: white;
}
.recording-stop:hover { box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4); }

.mic-btn.recording {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    animation: pulseRecord 1s ease-in-out infinite;
}

/* Poll Card */
.poll-card {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    min-width: 240px;
}
.poll-loading {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}
.poll-question {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    word-break: break-word;
}
.poll-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.poll-option-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xs);
    padding: 8px 10px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}
.poll-option-btn:not(:disabled):hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--primary);
}
.poll-option-btn:disabled {
    cursor: default;
    opacity: 0.85;
}
.poll-option.voted .poll-option-btn {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.4);
}
.poll-option-text {
    font-size: 13px;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}
.poll-option-pct {
    font-size: 11px;
    color: var(--text-muted);
    position: absolute;
    top: 8px;
    right: 10px;
    font-weight: 600;
}
.poll-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}
.poll-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    transition: width 0.4s ease;
}
.poll-option.voted .poll-bar-fill {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}
.poll-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    color: var(--text-muted);
}
.poll-closed {
    color: #f59e0b;
    font-weight: 600;
}
.poll-close-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-xs);
    padding: 2px 10px;
    color: #ef4444;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
    transition: var(--transition);
}
.poll-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}
