        /* Facebook Color Palette */
        :root {
            --fb-blue: #1877F2;
            --fb-green: #42B72A;
            --fb-red: #F02849;
            --fb-yellow: #F7B928;
            --fb-dark-green: #45BD62;
            --fb-gray-blue: #8B9DC3;
            --fb-bg: #F0F2F5;
            --fb-white: #FFFFFF;
            --fb-black: #050505;
            --fb-gray: #65676B;
            --fb-light-gray: #E4E6EB;
            --fb-border: #CED0D4;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        }

        body {
            background: var(--fb-bg);
            color: var(--fb-black);
            height: 100vh;
            overflow: hidden;
        }

        /* Login Page */
        .login-container {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            padding: 20px;
            background: linear-gradient(120deg, var(--fb-blue) 0%, var(--fb-dark-green) 100%);
        }

        .login-box {
            background: var(--fb-white);
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 420px;
            overflow: hidden;
            animation: slideUp 0.5s ease;
        }

        .login-header {
            background: var(--fb-blue);
            color: var(--fb-white);
            padding: 30px;
            text-align: center;
        }

        .login-header h1 {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
        }

        .login-header p {
            opacity: 0.9;
            font-size: 15px;
        }

        .login-form {
            padding: 30px;
        }

        .input-group {
            margin-bottom: 20px;
        }

        .input-group label {
            display: block;
            margin-bottom: 8px;
            color: var(--fb-gray);
            font-size: 14px;
            font-weight: 600;
        }

        .input-wrapper {
            position: relative;
        }

        .input-wrapper input {
            width: 100%;
            padding: 14px 16px;
            border: 1px solid var(--fb-border);
            border-radius: 8px;
            font-size: 16px;
            background: var(--fb-white);
            transition: all 0.2s;
        }

        .input-wrapper input:focus {
            outline: none;
            border-color: var(--fb-blue);
            box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
        }

        .input-wrapper .country-code {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--fb-gray);
            font-weight: 500;
        }

        .phone-input {
            padding-left: 55px !important;
        }

        .login-button {
            width: 100%;
            padding: 14px;
            background: var(--fb-blue);
            color: var(--fb-white);
            border: none;
            border-radius: 8px;
            font-size: 18px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-top: 10px;
        }

        .login-button:hover {
            background: linear-gradient(135deg, var(--fb-blue), var(--fb-gray-blue));
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
        }

        .login-button:disabled {
            background: var(--fb-light-gray);
            color: var(--fb-gray);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .login-info {
            margin-top: 24px;
            padding: 16px;
            background: var(--fb-bg);
            border-radius: 8px;
            border-left: 4px solid var(--fb-green);
            font-size: 14px;
            color: var(--fb-gray);
        }

        .login-info h4 {
            color: var(--fb-black);
            margin-bottom: 8px;
            font-size: 15px;
        }

        .info-items {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .info-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .info-item i {
            color: var(--fb-blue);
            width: 16px;
        }

        .stats {
            display: flex;
            gap: 20px;
            margin-top: 15px;
        }

        .stat {
            text-align: center;
            flex: 1;
        }

        .stat-number {
            font-size: 20px;
            font-weight: 700;
            color: var(--fb-blue);
        }

        .stat-label {
            font-size: 12px;
            color: var(--fb-gray);
            margin-top: 4px;
        }

        /* Verification Page */
        .verification-box {
            text-align: center;
        }

        .verification-icon {
            width: 80px;
            height: 80px;
            background: var(--fb-green);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
            font-size: 36px;
            color: var(--fb-white);
        }

        .verification-message {
            color: var(--fb-gray);
            margin-bottom: 20px;
            line-height: 1.5;
        }

        .verification-code {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin: 20px 0;
        }

        .code-input {
            width: 50px;
            height: 60px;
            text-align: center;
            font-size: 24px;
            font-weight: 700;
            border: 2px solid var(--fb-border);
            border-radius: 8px;
            background: var(--fb-white);
            transition: all 0.2s;
        }

        .code-input:focus {
            outline: none;
            border-color: var(--fb-blue);
            box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
        }

        .code-input.filled {
            border-color: var(--fb-blue);
            background: rgba(24, 119, 242, 0.05);
        }

        .resend-code {
            margin-top: 20px;
            color: var(--fb-blue);
            background: none;
            border: none;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
        }

        .resend-code:hover {
            text-decoration: underline;
        }

        /* Chat Page */
        .chat-container {
            display: flex;
            height: 100vh;
        }

        /* Sidebar */
        .sidebar {
            width: 360px;
            background: var(--fb-white);
            border-right: 1px solid var(--fb-border);
            display: flex;
            flex-direction: column;
            box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
        }

        .sidebar-header {
            padding: 20px;
            border-bottom: 1px solid var(--fb-border);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--fb-blue);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--fb-white);
            font-weight: 700;
            font-size: 16px;
        }

        .user-info {
            flex: 1;
        }

        .user-name {
            font-weight: 600;
            font-size: 16px;
        }

        .user-status {
            font-size: 12px;
            color: var(--fb-green);
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            background: currentColor;
            border-radius: 50%;
        }

        .sidebar-content {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        .section-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--fb-gray);
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .online-users {
            margin-bottom: 24px;
        }

        .user-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s;
            margin-bottom: 4px;
        }

        .user-item:hover {
            background: var(--fb-bg);
        }

        .user-item-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--fb-white);
            font-weight: 600;
            font-size: 14px;
        }

        .user-item-info {
            flex: 1;
        }

        .user-item-name {
            font-weight: 500;
            font-size: 14px;
        }

        .user-item-status {
            font-size: 11px;
            color: var(--fb-gray);
        }

        .user-item-status.online {
            color: var(--fb-green);
        }

        .group-stats {
            background: var(--fb-bg);
            border-radius: 8px;
            padding: 16px;
            margin-bottom: 20px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        .stat-card {
            text-align: center;
            padding: 12px;
            background: var(--fb-white);
            border-radius: 6px;
            border: 1px solid var(--fb-border);
        }

        .stat-number {
            font-size: 20px;
            font-weight: 700;
            color: var(--fb-blue);
            margin-bottom: 4px;
        }

        .stat-label {
            font-size: 11px;
            color: var(--fb-gray);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Chat Area */
        .chat-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--fb-white);
        }

        .chat-header {
            padding: 16px 24px;
            border-bottom: 1px solid var(--fb-border);
            display: flex;
            align-items: center;
            gap: 16px;
            background: var(--fb-white);
        }

        .group-avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--fb-blue), var(--fb-dark-green));
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--fb-white);
            font-size: 20px;
        }

        .group-info {
            flex: 1;
        }

        .group-name {
            font-weight: 600;
            font-size: 18px;
            margin-bottom: 4px;
        }

        .group-status {
            font-size: 13px;
            color: var(--fb-gray);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .group-actions {
            display: flex;
            gap: 12px;
        }

        .action-button {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: var(--fb-light-gray);
            color: var(--fb-gray);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .action-button:hover {
            background: var(--fb-border);
            color: var(--fb-black);
        }

        .action-button.active {
            background: var(--fb-blue);
            color: var(--fb-white);
        }

        /* Messages Area */
        .messages-area {
            flex: 1;
            padding: 24px;
            overflow-y: auto;
            background: var(--fb-bg);
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .message {
            max-width: 70%;
            display: flex;
            flex-direction: column;
            animation: fadeIn 0.3s ease;
        }

        .message.sent {
            align-self: flex-end;
        }

        .message.received {
            align-self: flex-start;
        }

        .message-sender {
            font-size: 12px;
            font-weight: 600;
            color: var(--fb-gray);
            margin-bottom: 4px;
            padding: 0 12px;
        }

        .message.received .message-sender {
            color: var(--fb-blue);
        }

        .message-bubble {
            padding: 12px 16px;
            border-radius: 18px;
            position: relative;
            word-wrap: break-word;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            line-height: 1.4;
        }

        .message.sent .message-bubble {
            background: var(--fb-blue);
            color: var(--fb-white);
            border-bottom-right-radius: 4px;
        }

        .message.received .message-bubble {
            background: var(--fb-white);
            color: var(--fb-black);
            border: 1px solid var(--fb-border);
            border-bottom-left-radius: 4px;
        }

        .message-time {
            font-size: 11px;
            color: var(--fb-gray);
            margin-top: 4px;
            padding: 0 12px;
            text-align: right;
        }

        .message.received .message-time {
            text-align: left;
        }

        /* Media Messages */
        .media-message {
            margin-top: 8px;
            border-radius: 12px;
            overflow: hidden;
            max-width: 300px;
        }

        .message-image {
            width: 100%;
            height: auto;
            display: block;
            cursor: pointer;
            transition: transform 0.2s;
        }

        .message-image:hover {
            transform: scale(1.02);
        }

        .audio-message {
            width: 100%;
            margin-top: 8px;
        }

        audio {
            width: 100%;
            border-radius: 20px;
        }

        .file-message {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: var(--fb-white);
            border: 1px solid var(--fb-border);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .file-message:hover {
            background: var(--fb-bg);
            border-color: var(--fb-blue);
        }

        .file-icon {
            font-size: 24px;
            color: var(--fb-blue);
        }

        .file-info {
            flex: 1;
            min-width: 0;
        }

        .file-name {
            font-weight: 600;
            font-size: 14px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 2px;
        }

        .file-size {
            font-size: 12px;
            color: var(--fb-gray);
        }

        /* Message Input */
        .message-input-area {
            padding: 20px 24px;
            border-top: 1px solid var(--fb-border);
            background: var(--fb-white);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .input-tools {
            display: flex;
            gap: 8px;
        }

        .tool-button {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: var(--fb-light-gray);
            color: var(--fb-gray);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .tool-button:hover {
            background: var(--fb-border);
            color: var(--fb-black);
        }

        .tool-button.recording {
            background: var(--fb-red);
            color: var(--fb-white);
            animation: pulse 1.5s infinite;
        }

        .message-input-wrapper {
            flex: 1;
            position: relative;
        }

        .message-input {
            width: 100%;
            padding: 12px 20px;
            border: 1px solid var(--fb-border);
            border-radius: 20px;
            background: var(--fb-bg);
            font-size: 15px;
            resize: none;
            max-height: 120px;
            min-height: 44px;
            line-height: 1.4;
        }

        .message-input:focus {
            outline: none;
            border-color: var(--fb-blue);
            background: var(--fb-white);
        }

        .send-button {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: var(--fb-blue);
            color: var(--fb-white);
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            transition: all 0.2s;
            flex-shrink: 0;
        }

        .send-button:hover {
            background: linear-gradient(135deg, var(--fb-blue), var(--fb-dark-green));
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
        }

        .send-button:disabled {
            background: var(--fb-light-gray);
            color: var(--fb-gray);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* File Preview */
        .file-preview {
            padding: 16px 24px;
            background: var(--fb-bg);
            border-top: 1px solid var(--fb-border);
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            max-height: 140px;
            overflow-y: auto;
        }

        .preview-item {
            background: var(--fb-white);
            border: 1px solid var(--fb-border);
            border-radius: 8px;
            padding: 12px;
            display: flex;
            align-items: center;
            gap: 12px;
            max-width: 280px;
            position: relative;
        }

        .preview-icon {
            font-size: 20px;
            color: var(--fb-blue);
        }

        .preview-info {
            flex: 1;
            min-width: 0;
        }

        .preview-name {
            font-weight: 600;
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 2px;
        }

        .preview-size {
            font-size: 11px;
            color: var(--fb-gray);
        }

        .preview-remove {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: none;
            background: var(--fb-light-gray);
            color: var(--fb-gray);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            transition: all 0.2s;
        }

        .preview-remove:hover {
            background: var(--fb-red);
            color: var(--fb-white);
        }

        /* Notifications */
        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 16px 20px;
            background: var(--fb-white);
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 1000;
            animation: slideInRight 0.3s ease;
            max-width: 360px;
            border-left: 4px solid var(--fb-blue);
        }

        .notification.success {
            border-left-color: var(--fb-green);
        }

        .notification.error {
            border-left-color: var(--fb-red);
        }

        .notification.warning {
            border-left-color: var(--fb-yellow);
        }

        .notification-icon {
            font-size: 20px;
        }

        .notification.success .notification-icon {
            color: var(--fb-green);
        }

        .notification.error .notification-icon {
            color: var(--fb-red);
        }

        .notification.warning .notification-icon {
            color: var(--fb-yellow);
        }

        .notification-content {
            flex: 1;
        }

        .notification-title {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 4px;
        }

        .notification-message {
            font-size: 13px;
            color: var(--fb-gray);
            line-height: 1.4;
        }

        .notification-close {
            background: none;
            border: none;
            color: var(--fb-gray);
            cursor: pointer;
            font-size: 18px;
            padding: 4px;
            transition: color 0.2s;
        }

        .notification-close:hover {
            color: var(--fb-black);
        }

        /* Loading */
        .loading {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid var(--fb-light-gray);
            border-top: 3px solid var(--fb-blue);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        /* Animations */
        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(20px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        /* Responsive */
        @media (max-width: 768px) {
            .chat-container {
                flex-direction: column;
            }
            
            .sidebar {
                width: 100%;
                height: auto;
                position: absolute;
                top: 0;
                left: 0;
                z-index: 100;
                display: none;
            }
            
            .sidebar.active {
                display: flex;
            }
            
            .mobile-menu-button {
                display: block;
            }
        }

        /* Hidden */
        .hidden {
            display: none !important;
        }

        /* Typing Indicator */
        .typing-indicator {
            font-size: 12px;
            color: var(--fb-gray);
            padding: 8px 16px;
            display: none;
        }

        .typing-indicator.active {
            display: block;
            animation: fadeIn 0.3s;
        }

        .typing-dots {
            display: inline-block;
        }

        .typing-dots span {
            animation: blink 1.4s infinite;
            animation-fill-mode: both;
            display: inline-block;
        }

        .typing-dots span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-dots span:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes blink {
            0%, 100% { opacity: 0.2; }
            50% { opacity: 1; }
        }