        :root {
            --primary: #7E57C2;
            --primary-dark: #5E35B1;
            --primary-light: #B39DDB;
            --secondary: #F5F5F5;
            --accent: #FFD54F;
            --text-dark: #333333;
            --text-light: #666666;
            --white: #FFFFFF;
            --shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s ease;
        }

        .dark-mode {
            --primary: #6a0dad;
            --primary-dark: #5a0c9c;
            --primary-light: #8a4dcc;
            --secondary: #1a0a24;
            --accent: #00c6ff;
            --text-dark: #ffffff;
            --text-light: #e0e0e0;
            --white: #1a0a24;
            --shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Tajawal', sans-serif;
        }

        body {
            background-color: var(--secondary);
            color: var(--text-dark);
            line-height: 1.7;
            overflow-x: hidden;
            transition: var(--transition);
        }

        .container {
            width: 90%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 15px;
        }

        .btn {
            display: inline-block;
            padding: 14px 35px;
            background-color: var(--primary);
            color: var(--white);
            border: none;
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
            text-align: center;
            box-shadow: 0 4px 10px rgba(126, 87, 194, 0.3);
        }

        .btn:hover {
            background-color: var(--primary-dark);
            transform: translateY(-5px);
            box-shadow: 0 7px 15px rgba(126, 87, 194, 0.4);
        }

        .theme-switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 30px;
        }

        .theme-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            right: 0;
            left: 0;
            bottom: 0;
            background-color: var(--primary-light);
            transition: var(--transition);
            border-radius: 34px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 8px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 22px;
            width: 22px;
            right: 4px;
            bottom: 4px;
            background-color: white;
            transition: var(--transition);
            border-radius: 50%;
            z-index: 2;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
            font-size: 12px;
            color: var(--primary);
        }

        input:checked+.slider {
            background-color: var(--primary);
        }

        input:checked+.slider:before {
            transform: translateX(-30px);
            content: "\f186";
            color: var(--accent);
        }

        input:not(:checked)+.slider:before {
            content: "\f185";
        }

        .slider .sun-icon,
        .slider .moon-icon {
            font-size: 14px;
            color: white;
            z-index: 1;
        }

        .sun-icon {
            opacity: 1;
            transition: var(--transition);
        }

        .moon-icon {
            opacity: 0;
            transition: var(--transition);
        }

        input:checked+.slider .sun-icon {
            opacity: 0;
        }

        input:checked+.slider .moon-icon {
            opacity: 1;
        }

        .chat-container {
            display: flex;
            flex-direction: column;
            height: 100vh;
            width: 100%;
            background-color: var(--white);
            overflow: hidden;
        }

        .chat-header {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: var(--white);
            padding: 20px 30px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: var(--shadow);
            position: relative;
            z-index: 10;
        }

        .chat-header h2 {
            font-size: 1.8rem;
            font-weight: 700;
            display: flex;
            align-items: center;
        }

        .chat-header h2 i {
            margin-left: 12px;
            font-size: 1.6rem;
        }

        .header-controls {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .back-btn {
            background: rgba(255, 255, 255, 0.2);
            color: var(--white);
            border: none;
            border-radius: 50%;
            width: 45px;
            height: 45px;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }

        .back-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-3px);
        }

        .chat-messages {
            flex: 1;
            padding: 25px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 20px;
            background-color: var(--secondary);
        }

        .message {
            max-width: 75%;
            padding: 15px 20px;
            border-radius: 20px;
            position: relative;
            line-height: 1.5;
            animation: fadeIn 0.3s ease;
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .message.received {
            background-color: var(--white);
            color: var(--text-dark);
            border-bottom-right-radius: 5px;
            align-self: flex-start;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .message.sent {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            border-bottom-left-radius: 5px;
            align-self: flex-end;
            box-shadow: 0 2px 8px rgba(98, 70, 146, 0.3);
            flex-direction: row-reverse;
        }

        .message-avatar {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            color: white;
            flex-shrink: 0;
        }

        .message-content-wrapper {
            flex: 1;
        }

        .message-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 0.85rem;
            opacity: 0.8;
        }

        .message-sender {
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .user-level {
            background: var(--accent);
            color: var(--text-dark);
            font-size: 0.7rem;
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: 700;
        }

        .message-time {
            font-size: 0.75rem;
        }

        .message-content {
            font-size: 1rem;
        }

        .chat-input-container {
            display: flex;
            padding: 20px;
            background-color: var(--white);
            border-top: 1px solid #eee;
        }

        .chat-input {
            flex: 1;
            padding: 15px 20px;
            border: 2px solid var(--primary-light);
            border-radius: 30px;
            font-size: 1rem;
            font-family: 'Tajawal', sans-serif;
            transition: var(--transition);
        }

        .chat-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2);
        }

        .send-btn {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: var(--white);
            border: none;
            border-radius: 50%;
            width: 55px;
            height: 55px;
            margin-right: 15px;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            box-shadow: 0 4px 10px rgba(126, 87, 194, 0.3);
        }

        .send-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 7px 15px rgba(126, 87, 194, 0.4);
        }

        .typing-indicator {
            display: flex;
            align-items: center;
            padding: 10px 20px;
            color: var(--text-light);
            font-style: italic;
            font-size: 0.9rem;
        }

        .typing-dots {
            display: flex;
            margin-right: 8px;
        }

        .typing-dot {
            width: 8px;
            height: 8px;
            background-color: var(--primary);
            border-radius: 50%;
            margin-left: 3px;
            animation: typing 1.4s infinite ease-in-out;
        }

        .typing-dot:nth-child(1) {
            animation-delay: -0.32s;
        }

        .typing-dot:nth-child(2) {
            animation-delay: -0.16s;
        }

        @keyframes typing {

            0%,
            80%,
            100% {
                transform: scale(0.8);
                opacity: 0.5;
            }

            40% {
                transform: scale(1);
                opacity: 1;
            }
        }

        .dark-mode .chat-container {
            background-color: var(--white);
        }

        .dark-mode .chat-messages {
            background-color: var(--secondary);
        }

        .dark-mode .message.received {
            background-color: rgba(255, 255, 255, 0.05);
            color: var(--text-dark);
            border: 1px solid rgba(255, 255, 255, 0.15);
        }

        .dark-mode .chat-input-container {
            background-color: var(--white);
            border-top-color: rgba(255, 255, 255, 0.15);
        }

        .dark-mode .chat-input {
            background-color: var(--white);
            color: var(--text-dark);
            border-color: rgba(255, 255, 255, 0.15);
        }

        .dark-mode .chat-input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.2);
        }

        @media (max-width: 768px) {
            .chat-header {
                padding: 15px 20px;
            }

            .chat-header h2 {
                font-size: 1.5rem;
            }

            .message {
                max-width: 85%;
            }

            .chat-messages {
                padding: 15px;
            }

            .header-controls {
                gap: 10px;
            }

            .message-avatar {
                width: 40px;
                height: 40px;
                font-size: 1rem;
            }
        }

        @media (max-width: 576px) {
            .chat-header h2 {
                font-size: 1.3rem;
            }

            .message {
                max-width: 90%;
                padding: 12px 15px;
            }

            .chat-input-container {
                padding: 15px;
            }

            .send-btn {
                width: 50px;
                height: 50px;
            }

            .back-btn {
                width: 40px;
                height: 40px;
            }

            .message-avatar {
                width: 35px;
                height: 35px;
                font-size: 0.9rem;
            }
        }
