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

html, body {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    min-height: 100dvh;
    color: #e8e8e8;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    max-width: 1600px;
    margin: 0 auto;
    overflow: hidden;
    width: 100%;
}

.sidebar {
    width: 280px;
    background: rgba(255,255,255,0.05);
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00d4aa, #00a884);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4aa, #00a884);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.online-status {
    font-size: 0.75rem;
    color: #00d4aa;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #00d4aa;
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #555;
    transition: 0.3s;
    border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
    background-color: #fff;
}
.email-notif-status {
    font-size: 0.7rem;
    margin-left: 6px;
    opacity: 0.7;
}

.room-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.room-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    position: relative;
}

.room-item:hover, .room-item.active {
    background: rgba(0, 212, 170, 0.15);
}

.dm-delete-btn {
    display: none;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,100,100,0.2);
    border: none;
    color: #ff6b6b;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s;
}

.dm-item-row:hover .dm-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-delete-btn:hover {
    background: rgba(255,100,100,0.4);
}

.back-to-lounge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0,212,170,0.15);
    border: none;
    color: #00d4aa;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
}

.back-to-lounge:hover {
    background: rgba(0,212,170,0.25);
}

.location-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    margin-left: auto;
}

.room-item.active {
    border-left: 3px solid #00d4aa;
}

.room-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.room-icon.main {
    background: linear-gradient(135deg, #00d4aa, #00a884);
}

.room-icon.group {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.room-icon.dm {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.room-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.unread-badge {
    background: #f5576c;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.room-item.has-unread {
    background: rgba(245, 87, 108, 0.1);
    border-left: 3px solid #f5576c;
    margin-left: auto;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.chat-header {
    padding: 1rem 1.5rem;
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.chat-subtitle {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

.online-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #00d4aa;
    font-size: 0.85rem;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #00d4aa;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

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

.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 80%;
}

.message.own {
    flex-direction: row-reverse;
    margin-left: auto;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message-avatar.bobby {
    background: linear-gradient(135deg, #00d4aa, #00a884);
}

.message-content {
    background: rgba(255,255,255,0.1);
    padding: 0.75rem 1rem;
    border-radius: 15px;
    border-top-left-radius: 5px;
}

.message.own .message-content {
    background: linear-gradient(135deg, #00d4aa, #00a884);
    color: white;
    border-radius: 15px;
    border-top-right-radius: 5px;
}

.message.bobby .message-content {
    background: linear-gradient(135deg, rgba(0,212,170,0.2), rgba(0,168,132,0.2));
    border: 1px solid rgba(0,212,170,0.3);
}

.message-sender {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #00d4aa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-tier-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-guest {
    background: rgba(156, 163, 175, 0.3);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.4);
}

.badge-registered {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.badge-verified {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.4);
}

.badge-bobby {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.3), rgba(0, 168, 132, 0.3));
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.5);
}

.message-text {
    font-size: 0.9rem;
    line-height: 1.5;
}

.message-time {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.25rem;
}

.message-media {
    max-width: 300px;
    max-height: 300px;
    border-radius: 10px;
    margin-top: 0.5rem;
    cursor: pointer;
    object-fit: contain;
}

.attachment-link {
    display: block;
}

.audio-attachment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.audio-attachment audio {
    height: 36px;
    flex: 1;
}

.file-attachment {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.file-attachment:hover {
    background: rgba(255,255,255,0.2);
}

.file-attachment .file-icon {
    font-size: 1.5rem;
}

.file-attachment .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.file-attachment .download-icon {
    opacity: 0.7;
}

.message-input-area {
    padding: 1rem 1.5rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.input-container {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.input-field-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 25px;
    padding: 0.25rem;
    transition: border-color 0.2s;
}

.input-field-wrapper:focus-within {
    border-color: #00d4aa;
}

.input-icon-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.input-icon-btn:hover {
    opacity: 1;
}

.input-icon-btn.left {
    padding-left: 0.75rem;
}

.input-icon-btn.right {
    padding-right: 0.75rem;
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem 0.25rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    outline: none;
    min-width: 0;
}

.message-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.voice-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00d4aa, #00a884);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.voice-send-btn:hover {
    transform: scale(1.05);
}

.voice-send-btn .mic-icon {
    font-size: 1.3rem;
}

.input-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255,255,255,0.2);
}

.action-btn.send {
    background: linear-gradient(135deg, #00d4aa, #00a884);
}

.action-btn.send:hover {
    transform: scale(1.05);
}

.members-panel {
    width: 240px;
    background: rgba(255,255,255,0.05);
    border-left: 1px solid rgba(255,255,255,0.1);
    padding: 1rem;
    display: none;
}

.members-panel.show {
    display: block;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.member-item:hover {
    background: rgba(255,255,255,0.05);
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.member-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid #1a1a2e;
}

.member-status.online {
    background: #00d4aa;
}

.member-status.offline {
    background: #666;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 2rem;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    padding: 2rem;
}

.login-required h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #00d4aa, #00a884);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-required p {
    color: rgba(255,255,255,0.7);
    margin-bottom: 2rem;
}

.login-btn {
    background: linear-gradient(135deg, #00d4aa, #00a884);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: scale(1.05);
}

.guest-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.guest-banner-text {
    flex: 1;
    min-width: 200px;
}

.guest-banner-btn {
    background: white;
    color: #d97706;
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.guest-banner-btn:hover {
    background: #fef3c7;
}

.guest-banner-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
}

.guest-banner-close:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .guest-banner {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .guest-banner-text {
        min-width: 150px;
    }
}

.sidebar-back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
    transition: all 0.2s;
}

.sidebar-back-link:hover {
    color: #00d4aa;
    background: rgba(0, 212, 170, 0.1);
}

@media (max-width: 1024px) {
    .members-panel {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        z-index: 10000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.7);
        z-index: 9999;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .menu-toggle {
        display: flex !important;
        min-width: 44px;
        min-height: 44px;
        margin-right: 10px;
    }
    
    .sidebar-close-btn {
        display: flex !important;
    }
    
    .sidebar-header {
        position: relative;
    }

    .chat-header {
        padding: 0.75rem 1rem;
        padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    }

    .messages-container {
        padding: 1rem;
        padding-bottom: 100px;
    }
    
    .message-input-area {
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .message {
        max-width: 90%;
    }

    #generic-install-banner,
    #ios-install-banner {
        flex-wrap: wrap;
        padding: 12px 15px;
        gap: 8px;
    }
    
    #generic-install-banner > div:first-child,
    #ios-install-banner > div:first-child {
        font-size: 1.5rem;
    }
    
    #generic-install-banner button,
    #ios-install-banner button {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .brand-name {
        font-size: 1.2rem;
    }
    
    .menu-toggle {
        min-width: 40px;
        min-height: 40px;
    }

    .chat-title {
        font-size: 1rem;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .message-content {
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
    }

    .message-input {
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 0.5rem 0.75rem;
        padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
    }

    .chat-title {
        font-size: 0.9rem;
    }

    .online-count {
        font-size: 0.75rem;
    }
    
    .message-input-area {
        padding: 0.5rem 0.75rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }
    
    .input-container {
        gap: 0.35rem;
        flex-wrap: nowrap;
    }
    
    .input-field-wrapper {
        padding: 0.15rem;
        flex: 1;
        min-width: 0;
    }
    
    .input-icon-btn {
        font-size: 1.2rem;
        padding: 0.35rem;
    }
    
    .input-icon-btn.left {
        padding-left: 0.5rem;
    }
    
    .input-icon-btn.right {
        padding-right: 0.5rem;
    }
    
    .voice-send-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        flex-shrink: 0;
    }

    .messages-container {
        padding: 0.75rem;
        gap: 0.75rem;
        padding-bottom: 120px;
    }

    .message {
        max-width: 95%;
        gap: 0.5rem;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .message-content {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .message-input {
        padding: 0.5rem 0.75rem;
        font-size: 16px;
        min-height: 40px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .emoji-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.1rem;
    }
    
    #emoji-picker {
        left: 5px !important;
        right: 5px !important;
        max-width: calc(100vw - 10px) !important;
        bottom: 80px !important;
    }
    
    #emoji-picker > div {
        grid-template-columns: repeat(7, 1fr) !important;
    }
    
    #emoji-picker button {
        font-size: 1.4rem !important;
        padding: 8px !important;
        min-width: 40px;
        min-height: 40px;
    }

    .brand-name {
        font-size: 1rem;
    }
    
    .sidebar-section-title {
        font-size: 0.7rem;
        padding: 0.5rem 0.75rem;
    }
    
    .channel-item, .dm-item {
        padding: 0.6rem 0.75rem;
        min-height: 44px;
    }
    
    .new-dm-btn {
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    .dm-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.25rem;
    }
    
    .dm-modal-title {
        font-size: 1.1rem;
    }
    
    .dm-search-input {
        font-size: 16px;
        min-height: 44px;
    }
    
    .dm-user-item {
        padding: 0.75rem;
        min-height: 48px;
    }
}

@media (max-width: 360px) {
    .brand-name {
        font-size: 0.9rem;
    }
    
    .menu-toggle {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }
    
    .chat-title {
        font-size: 0.8rem;
    }
    
    .message-input {
        font-size: 16px;
    }
    
    #emoji-picker button {
        font-size: 1.2rem !important;
        padding: 6px !important;
    }
    
    #emoji-picker > div {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.new-dm-btn {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 212, 170, 0.15);
    border: 1px dashed rgba(0, 212, 170, 0.5);
    border-radius: 10px;
    color: #00d4aa;
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.new-dm-btn:hover {
    background: rgba(0, 212, 170, 0.25);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

/* Search Bar Styles */
.sidebar-search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}
.sidebar-search-bar input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-size: 0.85rem;
    outline: none;
}
.sidebar-search-bar input::placeholder {
    color: rgba(255,255,255,0.4);
}
.sidebar-search-bar button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
}
.sidebar-search-bar button:hover {
    color: #00d4aa;
}

/* Header Actions Row */
.sidebar-header-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.sidebar-header-actions button {
    flex: 1;
    padding: 0.5rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.sidebar-header-actions button:hover {
    background: rgba(0,212,170,0.15);
    border-color: rgba(0,212,170,0.3);
}

/* Search Results Modal */
.search-results-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10001;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}
.search-results-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}
.search-result-item {
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.search-result-item:hover {
    background: rgba(0,212,170,0.1);
}
.search-result-sender {
    font-weight: 600;
    color: #00d4aa;
    font-size: 0.85rem;
}
.search-result-location {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-left: 0.5rem;
}
.search-result-snippet {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    margin-top: 0.25rem;
}
.search-result-time {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.25rem;
}

/* Reply Indicator Styles */
.reply-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0,212,170,0.1);
    border-left: 3px solid #00d4aa;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.5rem;
}
.reply-indicator-text {
    flex: 1;
    font-size: 0.85rem;
    color: #00d4aa;
}
.reply-indicator-cancel {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
}
.reply-indicator-cancel:hover {
    color: #ff6b6b;
}

/* Reply Reference in Messages */
.message-reply-ref {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border-left: 2px solid rgba(0,212,170,0.5);
    border-radius: 0 6px 6px 0;
    margin-bottom: 0.5rem;
    cursor: pointer;
}
.message-reply-ref:hover {
    background: rgba(255,255,255,0.1);
}

/* Message Actions */
.message-actions {
    display: none;
    position: absolute;
    top: -12px;
    right: 8px;
    background: #2d3748;
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.message:hover .message-actions {
    display: flex;
}
.message-action-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: all 0.2s;
}
.message-action-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Pinned Messages Section */
.pinned-messages-section {
    background: rgba(255,200,0,0.08);
    border: 1px solid rgba(255,200,0,0.2);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.pinned-messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.pinned-messages-header:hover {
    background: rgba(255,200,0,0.05);
}
.pinned-messages-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #ffc800;
    font-size: 0.9rem;
}
.pinned-messages-list {
    padding: 0 1rem 1rem;
    display: none;
}
.pinned-messages-list.show {
    display: block;
}
.pinned-message-item {
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.pinned-message-item:last-child {
    margin-bottom: 0;
}
.pinned-by {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.5rem;
}


/* Profile Modal Styles */
.profile-modal-field {
    margin-bottom: 1rem;
}
.profile-modal-field label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.35rem;
}
.profile-modal-field input,
.profile-modal-field select,
.profile-modal-field textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.profile-modal-field textarea {
    resize: vertical;
    min-height: 80px;
}
.profile-modal-field select option {
    background: #1a1a2e;
    color: white;
}

/* Member Directory Modal */
.member-directory-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.member-directory-item:hover {
    background: rgba(0,212,170,0.1);
}
.member-directory-info {
    flex: 1;
}
.member-directory-name {
    font-weight: 600;
    font-size: 0.95rem;
}
.member-directory-details {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.2rem;
}
