
        /* =============== Theme Variables =============== */
        :root {
            --bg-color: #000000;
            --text-color: #ffffff;
            --card-bg: #151515;
            --input-bg: #1e1e1e;
            --border-color: #333;
            --secondary-text: #a8b4c0;
            --tertiary-text: #6b7684;
            --hover-bg: rgba(255, 255, 255, 0.05);
            --glass-bg: rgba(10, 10, 10, 0.8);
            --electric-blue: #1d9bf0;
            --electric-blue-hover: #1a8cd8;
            --gradient-start: #1d9bf0;
            --gradient-end: #8b5cf6;
            --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        }

        .light-mode {
            --bg-color: #f8f9fa;
            --text-color: #212529;
            --card-bg: #ffffff;
            --input-bg: #f1f3f5;
            --border-color: #dee2e6;
            --secondary-text: #6c757d;
            --tertiary-text: #495057;
            --hover-bg: rgba(0, 0, 0, 0.05);
            --glass-bg: rgba(255, 255, 255, 0.8);
            --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        /* =============== Base & Reset =============== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: 'Space Grotesk', sans-serif;
            background: var(--bg-color);
            color: var(--text-color);
            min-height: 100vh;
            padding-bottom: 80px;
            transition: background-color 0.3s, color 0.3s;
        }

        /* =============== Header =============== */
        .header {
            position: fixed;
            top: 0;
            width: 100%;
            z-index: 100;
            background: var(--card-bg);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 1rem 2rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .back-btn {
            background: var(--hover-bg);
            color: var(--primary-text);
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0;
        }

        .header-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--text-color);
            text-align: center;
            flex: 1;
        }

        .block-user-btn {
            background: linear-gradient(135deg, #dc3545, #c82333);
            color: white;
            border: none;
            border-radius: 50px;
            padding: 0.5rem 1.25rem;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
        }

        .block-user-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* =============== Secondary Menu =============== */
        .secondary-menu {
            position: fixed;
            left: 50%;
            transform: translateX(-50%);
            bottom: -250px;
            width: 200px;
            background: var(--glass-bg);
            border-radius: 20px;
            padding: 1rem;
            backdrop-filter: blur(10px);
            transition: bottom 0.3s ease;
            z-index: 99;
            height: 240px;
            overflow-y: auto;
        }

        .secondary-menu.active {
            bottom: 85px;
        }

        .secondary-menu h3 {
            color: var(--electric-blue);
            margin-bottom: 1rem;
            font-size: 1.25rem;
            font-weight: 600;
        }

        .secondary-menu a {
            display: flex;
            align-items: center;
            padding: 0.75rem;
            margin-bottom: 0.5rem;
            color: var(--secondary-text);
            text-decoration: none;
            border-radius: 10px;
            transition: all 0.2s ease;
            font-size: 0.9rem;
            cursor: pointer;
        }

        .secondary-menu a:hover {
            background: var(--hover-bg);
            color: var(--electric-blue);
        }

        .secondary-menu a i {
            margin-right: 0.75rem;
            width: 16px;
            text-align: center;
        }

        /* =============== App Container =============== */
        .app-container {
            display: flex;
            flex-direction: column;
            height: 100vh;
            max-height: 100vh;
        }

        /* =============== Main View Container =============== */
        .view-container {
            flex: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            padding-top: 70px;
            padding-bottom: 70px;
        }

        /* =============== Chat List View =============== */
        .chat-list-view {
            display: flex;
            flex-direction: column;
            height: 100%;
            overflow: hidden;
        }

        .search-container {
            padding: 1rem 2rem;
            background: var(--card-bg);
            border-bottom: 1px solid var(--border-color);
            flex-shrink: 0;
        }

        .search-input {
            width: 100%;
            background-color: var(--input-bg);
                    border: none;

            border-radius: 50px;
            padding: 1rem 1.5rem;
            font-size: 1rem;
            color: var(--text-color);
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
            outline: none;
        }

        .search-input:focus {
            border-color: var(--electric-blue);
            box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.3);
        }

        .search-input::placeholder {
            color: var(--tertiary-text);
        }

        #chatUsersList {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 2rem;
        }

        .chat-user {
            background: var(--card-bg);
            border-radius: 20px;
            padding: 1.5rem;
                  border: none;

            backdrop-filter: blur(10px);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
        }

        .chat-user:hover {
            border-color: rgba(255, 255, 255, 0.2);
        }

        .chat-user img {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            object-fit: cover;
            margin-right: 1rem;
            border: 2px solid var(--electric-blue);
            flex-shrink: 0;
            loading: lazy;
        }

        .chat-user-info {
            flex: 1;
            min-width: 0;
        }

        .chat-user-info strong {
            color: var(--text-color);
            font-weight: 600;
            display: block;
            margin-bottom: 0.25rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .chat-user-info p {
            color: var(--secondary-text);
            font-size: 0.9rem;
            margin: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .loading {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2rem;
            color: var(--secondary-text);
        }

        .loading i {
            margin-right: 0.5rem;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* =============== Chat View =============== */
        .chat-view {
            display: flex;
            flex-direction: column;
            height: 100%;
            background: var(--bg-color);
      

        }

        .messages-container {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 2rem;
            background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSg0NSkiPjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjAzKSIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3QgZmlsbD0idXJsKCNwYXR0ZXJuKSIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIvPjwvc3ZnPg==');
        }

        .message-container {
            display: flex;
            margin-bottom: 1rem;
            
        }

        .sender-message-container {
            justify-content: flex-end;
        }

        .message-bubble {
            max-width: 75%;
            padding: 1rem 1.5rem;
            border-radius: 20px;
            position: relative;
            word-wrap: break-word;
            word-break: break-word;
            line-height: 1.4;
            font-size: 1rem;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
        }

        .sender-message-bubble {
            background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
            color: white;
            border-bottom-right-radius: 5px;
        }

        .message-bubble:not(.sender-message-bubble) {
            background: var(--card-bg);
                        border: none;

            color: var(--text-color);
            border-bottom-left-radius: 5px;
        }

        .message-input-container {
            display: flex;
            padding: 1rem 2rem;
            background: var(--card-bg);
            border-top: 1px solid var(--border-color);
            flex-shrink: 0;
            overflow-y: hidden;
        }

        .message-input-container input {
            flex: 1;
            background-color: var(--input-bg);
                     border: none;

            border-radius: 50px;
            padding: 1rem 1.5rem;
            font-size: 1rem;
            color: var(--text-color);
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            outline: none;
        }

        .message-input-container input:focus {
            border-color: var(--electric-blue);
            box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.3);
        }

        .message-input-container input::placeholder {
            color: var(--tertiary-text);
        }

        .message-input-container input:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .message-input-container button {
            background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
            color: white;
            border: none;
            border-radius: 50px;
            padding: 0.75rem 1.5rem;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
        }

        .message-input-container button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* =============== Error States =============== */
        .error-message {
            background: linear-gradient(135deg, #dc3545, #c82333);
            color: white;
            padding: 1rem 1.5rem;
            border-radius: 15px;
            margin: 1rem 2rem;
            text-align: center;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
        }

        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 60%;
            color: var(--secondary-text);
            text-align: center;
            padding: 2rem;
        }

        .empty-state i {
            font-size: 3rem;
            margin-bottom: 1rem;
            opacity: 0.5;
            color: var(--electric-blue);
        }

        .empty-state p {
            margin: 0;
            font-size: 1rem;
        }

        /* =============== Bottom Navigation =============== */
        .navbars {
            position: fixed;
            bottom: 0;
            width: 100%;
            z-index: 100;
            background: var(--card-bg);
            padding: 0.75rem 0;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        }

        .nav {
            display: flex;
            justify-content: space-around;
            align-items: center;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 1rem;
        }

        .nav a {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.25rem;
            color: var(--secondary-text);
            text-decoration: none;
            font-size: 0.8rem;
            padding: 0.5rem;
            border-radius: 10px;
            transition: all 0.2s ease;
        }

        .nav a i {
            font-size: 1.25rem;
        }

        .nav a:hover {
            background: var(--hover-bg);
            color: var(--electric-blue);
        }

        .nav a.active {
            color: var(--electric-blue);
        }

    

        #menu-btn i {
            font-size: 35px;
        }

       

        /* =============== Messages =============== */
        .message {
            position: fixed;
            top: 80px;
            left: 50%;
            transform: translateX(-50%);
            padding: 0.75rem 1.5rem;
            border-radius: 12px;
            font-weight: 500;
            z-index: 1100;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            max-width: 90%;
            text-align: center;
            display: none;
            animation: slideDown 0.3s ease-out;
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translate(-50%, -20px); }
            to { opacity: 1; transform: translate(-50%, 0); }
        }

        .error-message {
            background: rgba(239, 68, 68, 0.9);
            color: white;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .success-message {
            background: rgba(16, 185, 129, 0.9);
            color: white;
            border: 1px solid rgba(16, 185, 129, 0.3);
        }

        /* =============== Responsive Design =============== */
        @media (max-width: 768px) {
            .header {
                padding: 1rem;
            }
            .view-container {
                padding-top: 60px;
                padding-bottom: 70px;
            }
            .search-container,
            #chatUsersList,
            .messages-container,
            .message-input-container {
                padding: 1rem;
            }
            .nav a {
                font-size: 0.75rem;
            }
            .nav a i {
                font-size: 1.1rem;
            }
        }

        @media (max-width: 480px) {
            .header {
                padding: 0.75rem;
            }
            .search-container,
            #chatUsersList,
            .messages-container,
            .message-input-container {
                padding: 0.75rem;
            }
            .chat-user {
                padding: 1rem;
            }
            .chat-user img {
                width: 40px;
                height: 40px;
            }
            .nav a {
                font-size: 0.7rem;
            }
            .nav a i {
                font-size: 1rem;
            }
        }

        @media (min-width: 1024px) {
            .message-bubble {
                max-width: 60%;
            }
        }

        /* =============== Utility Classes =============== */
        .hidden {
            display: none !important;
        }

        /* =============== Scrollbar Styling =============== */
        ::-webkit-scrollbar {
            width: 6px;
        }

        ::-webkit-scrollbar-track {
            background: var(--card-bg);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border-color);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--electric-blue);
        }

        /* =============== Unread Indicator =============== */
        .unread-indicator {
            background: linear-gradient(135deg, #ff4757, #ff3742);
            color: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 600;
            margin-left: auto;
            flex-shrink: 0;
            box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
        }

        .chat-user.has-unread {
            border-left: 3px solid #ff4757;
        }

        .last-message-time {
            font-size: 0.75rem;
            color: var(--tertiary-text);
            margin-top: 0.25rem;
            white-space: nowrap;
        }

        /* =============== Theme Toggle =============== */
        #theme-toggle-secondary {
            display: flex;
            align-items: center;
            padding: 0.75rem;
            margin-bottom: 0.5rem;
            color: var(--secondary-text);
            text-decoration: none;
            border-radius: 10px;
            transition: all 0.2s ease;
            font-size: 0.9rem;
            cursor: pointer;
        }

        #theme-toggle-secondary:hover {
            background: var(--hover-bg);
            color: var(--electric-blue);
        }

        #theme-toggle-secondary i {
            margin-right: 0.75rem;
            width: 16px;
            text-align: center;
        }
    