* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #e5ddd5;
            height: 100vh;
            overflow: hidden;
        }

        /* Login Screen Styles */
        .login-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #075e54, #128c7e);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
        }
        .login-box {
            background: white;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            text-align: center;
            max-width: 400px;
            width: 90%;
            animation: loginSlide 0.5s ease-out;
        }
        @keyframes loginSlide {
            from {
                opacity: 0;
                transform: translateY(-50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .login-logo {
            width: 80px;
            height: 80px;
            background: #25d366;
            border-radius: 50%;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            color: white;
        }
        .login-title {
            font-size: 28px;
            color: #075e54;
            margin-bottom: 10px;
            font-weight: bold;
        }
        .login-subtitle {
            color: #666;
            margin-bottom: 30px;
            font-size: 16px;
        }
        .login-form {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        .password-input {
            padding: 15px 20px;
            border: 2px solid #e0e0e0;
            border-radius: 25px;
            font-size: 16px;
            outline: none;
            transition: all 0.3s;
            text-align: center;
        }
        .password-input:focus {
            border-color: #25d366;
            box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
        }
        .login-btn {
            padding: 15px 30px;
            background: #25d366;
            color: white;
            border: none;
            border-radius: 25px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s;
        }
        .login-btn:hover {
            background: #128c7e;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }
        .login-btn:active {
            transform: translateY(0);
        }
        .error-message {
            color: #f44336;
            font-size: 14px;
            margin-top: 10px;
            display: none;
            animation: shake 0.5s ease-in-out;
        }
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }
        .password-hint {
            font-size: 12px;
            color: #999;
            margin-top: 15px;
            padding: 10px;
            background: #f5f5f5;
            border-radius: 10px;
        }

        /* Chat Container Styles */
        .chat-container {
            width: 100vw;
            height: 100vh;
            background: white;
            display: flex;
            flex-direction: column;
            display: none;
        }
        .chat-header {
            background: #075e54;
            color: white;
            padding: 15px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            z-index: 10;
        }
        .header-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        .avatar {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background: #25d366;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 18px;
            color: white;
        }
        .chat-info h3 {
            font-size: 18px;
            margin-bottom: 2px;
        }
        .chat-info p {
            font-size: 13px;
            opacity: 0.8;
        }
        .online-status {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 12px;
            opacity: 0.9;
        }
        .online-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #25d366;
        }
        .online-dot.offline {
            background: #f44336;
        }
        .logout-btn, .settings-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            padding: 8px 15px;
            border-radius: 15px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.2s;
            margin-left: 10px;
        }
        .logout-btn:hover, .settings-btn:hover {
            background: rgba(255,255,255,0.3);
        }

        /* Load More Container */
        .load-more-container {
            text-align: center;
            padding: 10px;
            background: rgba(255,255,255,0.9);
            border-bottom: 1px solid #ddd;
            display: none;
        }
        .load-more-messages {
            background: #25d366;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 15px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.2s;
        }
        .load-more-messages:hover {
            background: #128c7e;
        }
        .load-more-messages:disabled {
            background: #ccc;
            cursor: not-allowed;
        }

        .chat-messages {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            background: #e5ddd5;
            background-image:
                radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 1px, transparent 1px),
                radial-gradient(circle at 75% 75%, rgba(255,255,255,0.1) 1px, transparent 1px);
            background-size: 30px 30px;
            background-repeat: repeat;
        }
        .chat-messages.custom-bg {
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
        }

        /* Loading Indicator */
        .loading-indicator {
            text-align: center;
            padding: 20px;
            color: #666;
            font-style: italic;
            display: none;
        }
        .loading-spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid #f3f3f3;
            border-top: 3px solid #25d366;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-right: 10px;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .message {
            margin-bottom: 15px;
            display: flex;
            align-items: flex-end;
            animation: messageSlide 0.3s ease-out;
            position: relative;
        }
        @keyframes messageSlide {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .message.sent {
            justify-content: flex-end;
        }
        .message.received {
            justify-content: flex-start;
        }
        .message-bubble {
            max-width: 70%;
            padding: 12px 16px;
            border-radius: 20px;
            position: relative;
            word-wrap: break-word;
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        }
        .message.sent .message-bubble {
            background: #dcf8c6;
            border-bottom-right-radius: 5px;
        }
        .message.received .message-bubble {
            background: white;
            border-bottom-left-radius: 5px;
        }
        .message-content {
            font-size: 16px;
            line-height: 1.4;
            margin-bottom: 5px;
        }
        .message-image {
            max-width: 100%;
            border-radius: 10px;
            margin-bottom: 10px;
            display: block;
            cursor: pointer;
        }

        /* Custom Audio Player Styles */
        .message-audio-player {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            background: rgba(0,0,0,0.05);
            border-radius: 15px;
            margin-bottom: 10px;
            width: 100%;
            min-width: 200px;
        }
        .message.sent .message-audio-player {
            background: rgba(0,0,0,0.08);
        }
        .audio-play-btn {
            background: #25d366;
            border: none;
            font-size: 16px;
            cursor: pointer;
            color: white;
            padding: 8px;
            border-radius: 50%;
            width: 35px;
            height: 35px;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            transition: all 0.2s;
        }
        .audio-play-btn:hover {
            background: #128c7e;
            transform: scale(1.05);
        }
        .audio-waveform {
            flex-grow: 1;
            height: 30px;
            background: rgba(0,0,0,0.1);
            border-radius: 15px;
            position: relative;
            cursor: pointer;
            overflow: hidden;
        }
        .audio-progress {
            height: 100%;
            width: 0%;
            background: #25d366;
            border-radius: 15px;
            transition: width 0.1s;
        }
        .audio-time {
            font-size: 12px;
            color: #666;
            min-width: 35px;
            text-align: right;
            font-weight: 500;
        }

        /* Message Reactions */
        .message-reactions {
            position: absolute;
            bottom: -15px;
            right: 10px;
            display: flex;
            gap: 2px;
            z-index: 5;
        }
        .message.received .message-reactions {
            left: 10px;
            right: auto;
        }
        .reaction {
            background: white;
            border: 1px solid #ddd;
            border-radius: 12px;
            padding: 2px 6px;
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 2px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            cursor: pointer;
            transition: all 0.2s;
        }
        .reaction:hover {
            transform: scale(1.05);
            box-shadow: 0 2px 5px rgba(0,0,0,0.15);
        }
        .reaction-count {
            font-size: 10px;
            color: #666;
            font-weight: bold;
        }
        .reaction-picker {
            position: absolute;
            bottom: 100%;
            right: 0;
            background: white;
            border-radius: 25px;
            padding: 8px 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            display: none;
            z-index: 10;
            animation: reactionSlide 0.2s ease-out;
        }
        .message.received .reaction-picker {
            left: 0;
            right: auto;
        }
        @keyframes reactionSlide {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .reaction-option {
            font-size: 20px;
            cursor: pointer;
            padding: 4px;
            border-radius: 50%;
            transition: all 0.2s;
            display: inline-block;
        }
        .reaction-option:hover {
            background: #f0f0f0;
            transform: scale(1.2);
        }

        .message-time {
            font-size: 12px;
            color: #666;
            text-align: right;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 5px;
        }
        .message.received .message-time {
            justify-content: flex-start;
        }
        .message-status {
            font-size: 16px;
            color: #4fc3f7;
        }
        .message-status.delivered {
            color: #999;
        }
        .message-status.sent {
            color: #999;
        }

        .chat-input-container {
            background: #f0f0f0;
            padding: 15px 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
        }
        .input-field {
            flex: 1;
            border: none;
            outline: none;
            padding: 12px 20px;
            border-radius: 25px;
            background: white;
            font-size: 16px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .send-btn, .attach-btn, .record-voice-btn {
            width: 50px;
            height: 50px;
            border: none;
            border-radius: 50%;
            background: #25d366;
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            transition: all 0.2s;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }
        .send-btn:hover, .attach-btn:hover, .record-voice-btn:hover {
            background: #128c7e;
            transform: scale(1.05);
        }
        .send-btn:active, .attach-btn:active, .record-voice-btn:active {
            transform: scale(0.95);
        }
        .send-btn:disabled, .record-voice-btn:disabled, .attach-btn:disabled, .input-field:disabled {
            background: #ccc;
            cursor: not-allowed;
            transform: none;
        }
        .record-voice-btn.recording {
            background: #f44336;
            animation: recordingPulse 1s infinite;
        }
        @keyframes recordingPulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        /* Scrollbar styling */
        .chat-messages::-webkit-scrollbar {
            width: 8px;
        }
        .chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }
        .chat-messages::-webkit-scrollbar-thumb {
            background: rgba(0,0,0,0.2);
            border-radius: 4px;
        }

        /* Typing indicator */
        .typing-indicator {
            display: none;
            padding: 10px 20px;
            font-style: italic;
            color: #666;
            font-size: 14px;
            background: rgba(255,255,255,0.8);
            border-radius: 10px;
            margin: 10px 20px;
        }
        .typing-dots {
            display: inline-block;
        }
        .typing-dots::after {
            content: '...';
            animation: typing 1.5s infinite;
        }
        @keyframes typing {
            0%, 60%, 100% { opacity: 0; }
            30% { opacity: 1; }
        }

        /* Connection status */
        .connection-status {
            font-size: 11px;
            opacity: 0.7;
        }
        .connected {
            color: #25d366;
        }
        .disconnected {
            color: #f44336;
        }

        /* Mobile responsiveness */
        @media (max-width: 480px) {
            .login-box {
                padding: 30px 20px;
                margin: 20px;
            }
            .login-title {
                font-size: 24px;
            }
        }

        /* Overlay Styles (for Image and Settings) */
        .overlay {
            display: none;
            position: fixed;
            z-index: 3000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.9);
            align-items: center;
            justify-content: center;
        }
        .overlay-content {
            margin: auto;
            display: block;
            max-width: 90%;
            max-height: 90%;
            border-radius: 10px;
        }
        .close-btn {
            position: absolute;
            top: 20px;
            right: 35px;
            color: #f1f1f1;
            font-size: 40px;
            font-weight: bold;
            transition: 0.3s;
            cursor: pointer;
        }
        .close-btn:hover,
        .close-btn:focus {
            color: #bbb;
            text-decoration: none;
            cursor: pointer;
        }

        /* Settings specific styles */
        .settings-box {
            background: white;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            text-align: center;
            max-width: 500px;
            width: 90%;
            color: #333;
        }
        .settings-box h2 {
            font-size: 24px;
            margin-bottom: 20px;
            color: #075e54;
        }
        .settings-option {
            margin-bottom: 20px;
            text-align: left;
        }
        .settings-option label {
            display: block;
            font-weight: bold;
            margin-bottom: 8px;
            color: #555;
        }
        .settings-option input[type="text"] {
            width: calc(100% - 22px);
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
        }
        .settings-option button {
            padding: 10px 20px;
            background: #25d366;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
            transition: background 0.3s;
            margin-top: 10px;
        }
        .settings-option button:hover {
            background: #128c7e;
        }
        .preset-backgrounds {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
            margin-top: 15px;
        }
        .preset-bg-thumbnail {
            width: 60px;
            height: 60px;
            border-radius: 8px;
            cursor: pointer;
            border: 2px solid transparent;
            transition: border-color 0.2s;
            background-size: cover;
            background-position: center;
        }
        .preset-bg-thumbnail:hover {
            border-color: #25d366;
        }
        .preset-bg-thumbnail.selected {
            border-color: #075e54;
            box-shadow: 0 0 0 2px rgba(7, 94, 84, 0.5);
        }

        /* Recording indicator style */
        .recording-timer {
            display: none;
            font-size: 14px;
            color: #f44336;
            margin-left: 10px;
            font-weight: bold;
            min-width: 40px;
            text-align: center;
            animation: pulse 1s infinite alternate;
        }
        @keyframes pulse {
            from { opacity: 1; }
            to { opacity: 0.7; }
        }

        /* Voice recording overlay */
        .voice-recording-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2500;
        }
        .voice-recording-box {
            background: white;
            padding: 40px;
            border-radius: 20px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            max-width: 300px;
            width: 90%;
        }
        .recording-animation {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: #f44336;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            color: white;
            animation: recordingPulse 1s infinite;
        }
        .recording-text {
            font-size: 18px;
            color: #333;
            margin-bottom: 10px;
        }
        .recording-duration {
            font-size: 24px;
            color: #f44336;
            font-weight: bold;
            margin-bottom: 20px;
        }
        .recording-controls {
            display: flex;
            gap: 20px;
            justify-content: center;
        }
        .recording-control-btn {
            width: 60px;
            height: 60px;
            border: none;
            border-radius: 50%;
            font-size: 24px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .cancel-recording {
            background: #f44336;
            color: white;
        }
        .stop-recording {
            background: #25d366;
            color: white;
        }
        .recording-control-btn:hover {
            transform: scale(1.1);
        }