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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 30%, #FFB300 60%, #FF8F00 100%);
    background-attachment: fixed;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: pan-x pan-y pinch-zoom; /* Allow scrolling and pinch zoom */
}

.screen {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Login Screen */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8em;
    font-weight: 600;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.tab.active {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: white;
}

.form-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-container input:focus {
    outline: none;
    border-color: #FFC107;
}

.form-container button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.form-container button:hover {
    background: linear-gradient(135deg, #FFB300 0%, #FFC107 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.error-message {
    margin-top: 15px;
    padding: 10px;
    background: #fee;
    color: #c33;
    border-radius: 8px;
    text-align: center;
    display: none;
}

/* App Screen */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    background: white;
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: #FFFBF0;
    border-left: 1px solid #FFE082;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-shadow: -2px 0 8px rgba(255, 193, 7, 0.2);
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.sidebar-header h2 {
    margin-bottom: 10px;
}

.theme-toggle-btn {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 6px;
    color: #333;
    cursor: pointer;
    font-size: 18px;
    margin-left: 8px;
    transition: all 0.3s;
}

.theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.logout-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

.search-container {
    padding: 15px;
    display: flex;
    gap: 10px;
}

.search-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.search-container button {
    padding: 10px 15px;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.actions {
    padding: 0 15px 15px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #FFB300 0%, #FFC107 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 179, 0, 0.5);
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 15px;
}

.chat-item {
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.chat-item:hover {
    background: #f0f0f0;
    transform: translateX(-5px);
}

.chat-item.active {
    border-color: #FFC107;
    background: #FFF9E6;
}

.chat-item h4 {
    margin-bottom: 5px;
    color: #333;
}

.chat-item p {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item .chat-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 11px;
    color: #999;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0; /* Important for flex */
}

#chatView {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0; /* Important for flex */
}

.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 18px;
}

.chat-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    color: #333;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #fafafa;
    /* Smooth scrolling - works in all browsers */
    -webkit-overflow-scrolling: touch; /* iOS Safari */
    scroll-behavior: smooth; /* Modern browsers */
    /* Scroll behavior for Chrome */
    overflow-scrolling: touch; /* Chrome fallback */
    /* Allow natural scroll bounce */
    overscroll-behavior-y: auto;
    -webkit-overscroll-behavior-y: auto;
    /* Flex properties */
    min-height: 0; /* Important for flex scrolling */
    flex-shrink: 1; /* Allow shrinking */
    /* Touch and interaction */
    touch-action: pan-y pinch-zoom; /* Enable vertical touch scrolling and pinch zoom */
    -ms-touch-action: pan-y pinch-zoom; /* IE/Edge */
    cursor: default; /* Normal cursor for mouse scrolling */
    /* Text selection */
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    /* Ensure scrolling works in Chrome */
    will-change: scroll-position;
    transform: translateZ(0); /* Force hardware acceleration for smooth scrolling */
}

.messages-container:empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.message.own {
    align-items: flex-start;
    direction: rtl;
}

.message.other {
    align-items: flex-end;
    direction: rtl;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message.own .message-bubble {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
    border-bottom-left-radius: 4px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.message.other .message-bubble {
    background: white;
    color: #333;
    border-bottom-right-radius: 4px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-bottom-left-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-info {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-receipt {
    color: #FF8F00;
    font-size: 12px;
    margin-right: 3px;
}

.read-receipt.unread {
    color: #999;
}

.unread-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 8px;
    min-width: 18px;
    text-align: center;
}

.message-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    flex-shrink: 0; /* Prevent shrinking */
    min-height: 70px; /* Ensure minimum height */
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.message-input-container input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    min-width: 0; /* Important for flex */
}

.message-input-container button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.message-input-container button:hover {
    background: linear-gradient(135deg, #FFB300 0%, #FFC107 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 179, 0, 0.5);
}

.message-input-container button:active {
    transform: scale(0.95);
}

.attach-btn {
    padding: 12px 15px;
    background: #FFE082;
    color: #FF8F00;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-btn:hover {
    background: #FFD54F;
    transform: scale(1.05);
}

.attach-btn:active {
    transform: scale(0.95);
}

.message-image {
    max-width: 250px;
    max-height: 300px;
    border-radius: 12px;
    margin-bottom: 5px;
    cursor: pointer;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-video {
    max-width: 300px;
    max-height: 400px;
    border-radius: 12px;
    margin-bottom: 5px;
}

.message-file {
    padding: 10px 15px;
    background: #FFF9E6;
    border-radius: 12px;
    margin-bottom: 5px;
    border: 1px solid #FFE082;
}

.file-link {
    color: #FF8F00;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-link:hover {
    text-decoration: underline;
    color: #FF6F00;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.selected-users {
    margin-bottom: 15px;
    min-height: 40px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.user-tag {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: white;
    border-radius: 16px;
    margin: 5px;
    font-size: 12px;
}

.user-results {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.user-result-item {
    padding: 10px;
    background: #f8f9fa;
    margin-bottom: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.user-result-item:hover {
    background: #e0e0e0;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-admin {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.4);
}

.btn-admin:hover {
    background: linear-gradient(135deg, #FFB300 0%, #FFC107 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 179, 0, 0.5);
}

.admin-users-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.admin-user-item {
    transition: all 0.3s;
}

.admin-user-item:hover {
    transform: translateX(-3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-chat-user {
    transition: background 0.3s;
}

.btn-chat-user:hover {
    background: #5568d3 !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.mobile-menu-close {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1002;
}

.chat-header-info {
    flex: 1;
    text-align: center;
}

.back-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #FF8F00;
    cursor: pointer;
    padding: 5px 10px;
    margin-right: 10px;
}

/* Ensure message input is visible on desktop */
@media (min-width: 769px) {
    .message-input-container {
        position: relative !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 70px !important;
        padding: 20px !important;
        background: white !important;
        border-top: 1px solid #e0e0e0 !important;
        z-index: 10 !important;
    }
    
    #chatView {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }
    
    #chatView .message-input-container {
        flex-shrink: 0 !important;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    body {
        overflow: hidden;
    }

    .app-container {
        max-width: 100%;
        box-shadow: none;
    }

    /* Login Screen Mobile */
    .login-container {
        padding: 30px 20px;
        margin: 20px;
        border-radius: 15px;
    }

    .login-container h1 {
        font-size: 2em;
        margin-bottom: 20px;
    }

    .tab {
        padding: 14px;
        font-size: 15px;
    }

    .form-container input,
    .form-container button {
        padding: 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Sidebar Mobile */
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-menu-btn {
        display: block;
        top: calc(15px + env(safe-area-inset-top));
    }

    .mobile-menu-close {
        display: block;
        top: calc(15px + env(safe-area-inset-top));
    }

    .sidebar-header {
        padding: 15px;
        padding-top: calc(60px + env(safe-area-inset-top));
        position: relative;
        background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    }

    .sidebar-header h2 {
        font-size: 1.3em;
        margin-bottom: 8px;
    }

    .user-info {
        font-size: 13px;
    }

    .logout-btn {
        padding: 8px 14px;
        font-size: 11px;
    }

    .search-container {
        padding: 12px;
    }

    .search-container input {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .search-container button {
        padding: 12px 18px;
        font-size: 18px;
    }

    .actions {
        padding: 0 12px 12px;
    }

    .btn-primary {
        padding: 14px;
        font-size: 15px;
    }

    .chats-list {
        padding: 0 12px;
    }

    .chat-item {
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 12px;
    }

    .chat-item h4 {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .chat-item p {
        font-size: 13px;
    }

    /* Chat Area Mobile */
    .chat-area {
        width: 100%;
    }

    .chat-header {
        padding: 15px;
        padding-top: calc(15px + env(safe-area-inset-top));
        position: sticky;
        top: 0;
        z-index: 100;
        background: linear-gradient(135deg, #FFFBF0 0%, #ffffff 100%);
        display: flex;
        align-items: center;
        border-bottom: 1px solid #FFE082;
        box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
    }

    .chat-header h3 {
        font-size: 18px;
    }

    .back-btn {
        display: block;
        font-size: 28px;
        padding: 0;
        margin-right: 15px;
    }

    .messages-container {
        padding: 15px;
        padding-bottom: 80px;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y pinch-zoom;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .message-bubble {
        max-width: 85%;
        padding: 10px 14px;
        font-size: 15px;
        line-height: 1.4;
    }

    .message-info {
        font-size: 10px;
        margin-top: 4px;
    }

    .message-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 15px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        background: white;
        border-top: 1px solid #e0e0e0;
        z-index: 100;
    }

    .message-input-container input {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 24px;
    }

    .message-input-container button {
        padding: 12px 18px;
        font-size: 20px;
        border-radius: 24px;
        min-width: 50px;
    }

    .empty-state {
        padding: 40px 20px;
        font-size: 16px;
        text-align: center;
    }

    /* Modal Mobile */
    .modal-content {
        width: 95%;
        padding: 25px 20px;
        max-height: 90vh;
        border-radius: 15px;
    }

    .modal-content h3 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .modal-content input {
        padding: 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .user-result-item {
        padding: 14px;
        font-size: 15px;
    }

    .btn-secondary {
        padding: 14px;
        font-size: 15px;
    }

    .btn-admin {
        padding: 14px;
        font-size: 15px;
        margin-top: 10px;
    }

    .admin-users-list {
        max-height: 50vh;
    }

    .admin-user-item {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .admin-user-item button {
        width: 100%;
        margin-top: 10px;
    }

    /* Prevent text selection on buttons */
    button {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
    }

    /* Better touch targets */
    .chat-item,
    .user-result-item,
    button {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Smooth scrolling */
    .chats-list,
    .messages-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Prevent pull-to-refresh but allow normal scrolling */
    body {
        overscroll-behavior-y: auto;
    }
    
    /* Ensure messages container can scroll freely */
    .messages-container {
        overscroll-behavior-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Better input focus */
    input:focus {
        outline: none;
        border-color: #FFC107;
    }

    /* Hide scrollbar on mobile for cleaner look */
    .chats-list::-webkit-scrollbar,
    .messages-container::-webkit-scrollbar {
        width: 4px;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 300px;
    }

    .message-bubble {
        max-width: 75%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .sidebar {
        width: 90%;
    }

    .message-bubble {
        max-width: 90%;
        padding: 10px 12px;
        font-size: 14px;
    }

    .chat-header {
        padding-top: 60px;
    }

    .mobile-menu-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-header {
        padding-top: 60px;
    }

    .messages-container {
        padding-bottom: 70px;
    }

    .message-input-container {
        padding-bottom: 10px;
    }
}

/* Dark Mode Styles - Support for both body and html selectors for Chrome compatibility */
body.dark-mode,
html.dark-mode body,
.dark-mode body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 30%, #1f1f1f 60%, #0f0f0f 100%) !important;
}

/* Also add dark-mode class to html element when body has it */
html.dark-mode {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 30%, #1f1f1f 60%, #0f0f0f 100%) !important;
}

/* Support both body.dark-mode and html.dark-mode for Chrome compatibility */
body.dark-mode .login-container,
html.dark-mode .login-container {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .login-container h1 {
    background: linear-gradient(135deg, #FFC107 0%, #FF8F00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .tab {
    background: #3d3d3d;
    color: #e0e0e0;
}

body.dark-mode .tab.active {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
}

body.dark-mode .form-container input {
    background: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .form-container input:focus {
    border-color: #FFC107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

body.dark-mode .sidebar {
    background: #1f1f1f;
    border-left: 1px solid #333;
}

body.dark-mode .sidebar-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    color: #e0e0e0;
    border-bottom: 1px solid #333;
}

body.dark-mode .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .logout-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .chats-list {
    background: #1f1f1f;
}

body.dark-mode .chat-item {
    background: #2d2d2d;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .chat-item:hover {
    background: #3d3d3d;
}

body.dark-mode .chat-item.active {
    background: #3d3d3d;
    border-color: #FFC107;
}

body.dark-mode .chat-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}

body.dark-mode .back-btn {
    color: #FFC107;
}

body.dark-mode .messages-container {
    background: #1a1a1a;
}

body.dark-mode .message.other .message-bubble {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .message.own .message-bubble {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
}

body.dark-mode .message-info {
    color: #999;
}

body.dark-mode .message-input-container {
    background: #2d2d2d;
    border-top: 1px solid #333;
}

body.dark-mode .message-input-container input {
    background: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .message-input-container input:focus {
    border-color: #FFC107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

body.dark-mode .attach-btn {
    background: #3d3d3d;
    color: #FFC107;
}

body.dark-mode .attach-btn:hover {
    background: #4d4d4d;
}

body.dark-mode .search-container input {
    background: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .search-container input:focus {
    border-color: #FFC107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

body.dark-mode .btn-primary {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
}

body.dark-mode .btn-admin {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
}

body.dark-mode .empty-state {
    color: #999;
}

body.dark-mode .error-message {
    background: #3d3d3d;
    color: #ff6b6b;
    border-color: #555;
}

body.dark-mode .modal {
    background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .modal-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .modal-content input {
    background: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .user-result-item {
    background: #3d3d3d;
    color: #e0e0e0;
}

body.dark-mode .user-result-item:hover {
    background: #4d4d4d;
}

body.dark-mode .user-tag {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
}

body.dark-mode .message-file {
    background: #3d3d3d;
    border-color: #555;
}

body.dark-mode .file-link {
    color: #FFC107;
}

body.dark-mode .mobile-menu-btn {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #333;
}

body.dark-mode .mobile-menu-close {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .admin-users-list {
    background: #2d2d2d;
}

body.dark-mode .admin-user-item {
    background: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .admin-user-item:hover {
    background: #4d4d4d;
}

