

/* Extracted from original HTML <style> blocks - concatenated */

@keyframes slideInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(-30px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        @keyframes bounceIn {
            0% {
                opacity: 0;
                transform: scale(0.3);
            }
            50% {
                opacity: 1;
                transform: scale(1.05);
            }
            70% {
                transform: scale(0.9);
            }
            100% {
                transform: scale(1);
            }
        }

        @keyframes pulseGlow {
            0%,
            100% {
                box-shadow: 0 0 5px rgba(0, 234, 255, 0.5);
            }
            50% {
                box-shadow: 0 0 20px rgba(0, 234, 255, 0.8), 0 0 30px rgba(0, 234, 255, 0.6);
            }
        }

        @keyframes shake {
            0%,
            100% {
                transform: translateX(0);
            }
            10%,
            30%,
            50%,
            70%,
            90% {
                transform: translateX(-5px);
            }
            20%,
            40%,
            60%,
            80% {
                transform: translateX(5px);
            }
        }

        @keyframes rotate {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }

        /* Planet Animation Keyframes */
        @keyframes earthSpin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        @keyframes satelliteOrbit {
            from { transform: rotate(0deg) translateX(35px) rotate(0deg); }
            to { transform: rotate(360deg) translateX(35px) rotate(-360deg); }
        }

        @keyframes saturnWobble {
            0%, 100% { transform: rotateX(20deg) rotateY(0deg); }
            50% { transform: rotateX(20deg) rotateY(10deg); }
        }

        @keyframes marsDust {
            0%, 100% { opacity: 0.2; transform: scale(1); }
            50% { opacity: 0.5; transform: scale(1.1); }
        }

        @keyframes jupiterFlow {
            from { background-position: 0 0; }
            to { background-position: 60px 0; }
        }

        @keyframes neptunePulse {
            0%, 100% { box-shadow: 0 0 15px rgba(59,130,246,0.5), inset 0 0 20px rgba(59,130,246,0.2); }
            50% { box-shadow: 0 0 30px rgba(59,130,246,0.7), inset 0 0 35px rgba(59,130,246,0.4); }
        }

        @keyframes moonPhase {
            0%, 100% { filter: brightness(0.9); }
            50% { filter: brightness(1.1); }
        }

        @keyframes starTwinkle {
            0%, 100% { opacity: 0.4; transform: scale(0.8); }
            50% { opacity: 1; transform: scale(1); }
        }

        /* Collection Item Styles */
        .collection-item {
            background: linear-gradient(145deg, #1a1a2e, #16213e);
            border-radius: 16px;
            padding: 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
            position: relative;
            overflow: hidden;
        }

        .collection-item:hover {
            transform: scale(1.03);
            box-shadow: 0 8px 25px rgba(0, 234, 255, 0.3);
        }

        .collection-item.selected {
            border-color: #00eaff;
            box-shadow: 0 0 20px rgba(0, 234, 255, 0.4);
        }

        .collection-item.selected::after {
            content: '✓';
            position: absolute;
            top: 8px;
            left: 8px;
            width: 24px;
            height: 24px;
            background: #00eaff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: #121212;
            font-weight: bold;
        }

        .planet-preview {
            width: 70px;
            height: 70px;
            margin: 0 auto 10px;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .collection-name {
            color: #fff;
            font-weight: 700;
            text-align: center;
            font-size: 1em;
        }

        .collection-desc {
            color: rgba(255,255,255,0.6);
            font-size: 0.75em;
            text-align: center;
            margin-top: 5px;
        }

        .collections-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-top: 20px;
        }

        .collections-header {
            text-align: center;
            margin-bottom: 20px;
        }

        .collections-header h4 {
            color: #00eaff;
            font-size: 1.5em;
            margin: 0 0 10px;
            border: none;
            width: auto;
        }

        .clear-collection-btn {
            background: rgba(255,255,255,0.1) !important;
            color: #aaa !important;
            width: 100%;
            margin-bottom: 15px;
        }

        /* Planet Animation Elements */
        .planet-earth {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(135deg, #3b82f6 0%, #22c55e 25%, #3b82f6 40%, #22c55e 55%, #3b82f6 70%, #22c55e 85%, #3b82f6 100%);
            animation: earthSpin 20s linear infinite;
            box-shadow: 0 0 20px rgba(59,130,246,0.5), inset -6px -6px 15px rgba(0,0,0,0.3);
            position: relative;
        }

        .planet-earth::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            opacity: 0.4;
        }

        .satellite {
            position: absolute;
            width: 8px;
            height: 6px;
            background: linear-gradient(to right, #d1d5db, #6b7280);
            border-radius: 2px;
            animation: satelliteOrbit 8s linear infinite;
            box-shadow: 0 0 8px rgba(255,255,255,0.8);
        }

        .satellite::before, .satellite::after {
            content: '';
            position: absolute;
            width: 4px;
            height: 8px;
            background: #2563eb;
            top: 50%;
            transform: translateY(-50%);
        }
        .satellite::before { left: -4px; }
        .satellite::after { right: -4px; }

        .planet-saturn-container {
            animation: saturnWobble 4s ease-in-out infinite;
            transform-style: preserve-3d;
        }

        .planet-saturn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background: linear-gradient(180deg, #fbbf24 0%, #d97706 20%, #fbbf24 40%, #b45309 60%, #fbbf24 80%, #d97706 100%);
            box-shadow: 0 0 20px rgba(251,191,36,0.4), inset -5px -5px 12px rgba(0,0,0,0.3);
            position: relative;
        }

        .saturn-rings {
            position: absolute;
            width: 80px;
            height: 20px;
            border: 3px solid rgba(251,191,36,0.5);
            border-radius: 50%;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) rotateX(75deg);
            background: linear-gradient(90deg, transparent, rgba(251,191,36,0.3), rgba(217,119,6,0.4), rgba(251,191,36,0.3), transparent);
        }

        .planet-mars {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: radial-gradient(circle at 60% 40%, #c2410c 0%, transparent 30%),
                        radial-gradient(circle at 25% 60%, #9a3412 0%, transparent 25%),
                        linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
            animation: earthSpin 25s linear infinite;
            box-shadow: 0 0 20px rgba(239,68,68,0.5), inset -6px -6px 15px rgba(0,0,0,0.4);
            position: relative;
        }

        .planet-mars::before {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 33%;
            height: 16%;
            background: rgba(255,255,255,0.3);
            border-radius: 0 0 50% 50%;
        }

        .mars-dust {
            position: absolute;
            width: 25px;
            height: 25px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(251,146,60,0.4) 0%, transparent 70%);
            animation: marsDust 3s ease-in-out infinite;
            top: 30%;
            left: 60%;
        }

        .planet-jupiter {
            width: 55px;
            height: 55px;
            border-radius: 50%;
            background: linear-gradient(180deg, #fbbf24 0%, #f97316 15%, #fde68a 25%, #ea580c 35%, #fbbf24 45%, #dc2626 55%, #fcd34d 65%, #f97316 75%, #fde68a 85%, #ea580c 100%);
            box-shadow: 0 0 25px rgba(251,146,60,0.5), inset -8px -8px 20px rgba(0,0,0,0.3);
            position: relative;
            overflow: hidden;
        }

        .jupiter-bands {
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(180deg, transparent 0px, rgba(255,255,255,0.1) 5px, transparent 10px, rgba(0,0,0,0.1) 15px, transparent 20px);
            animation: jupiterFlow 10s linear infinite;
            opacity: 0.4;
        }

        .jupiter-spot {
            position: absolute;
            width: 15px;
            height: 10px;
            border-radius: 50%;
            background: radial-gradient(ellipse, #dc2626 30%, #991b1b 70%, transparent 100%);
            top: 55%;
            left: 30%;
            animation: earthSpin 12s linear infinite;
            box-shadow: inset 2px 2px 4px rgba(0,0,0,0.3);
        }

        .planet-neptune {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.2), transparent 40%),
                        radial-gradient(circle at 50% 50%, #2563eb 0%, #1d4ed8 50%, #1e3a8a 100%);
            animation: neptunePulse 2s ease-in-out infinite, earthSpin 18s linear infinite;
            position: relative;
        }

        .neptune-bands {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: linear-gradient(180deg, transparent 0%, rgba(147,197,253,0.2) 20%, transparent 40%, rgba(96,165,250,0.15) 60%, transparent 80%);
        }

        .neptune-spot {
            position: absolute;
            width: 12px;
            height: 8px;
            border-radius: 50%;
            background: radial-gradient(ellipse, #1e3a8a 30%, #172554 70%);
            top: 40%;
            left: 25%;
        }

        .planet-moon {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: radial-gradient(circle at 35% 35%, #fafafa 0%, transparent 50%),
                        radial-gradient(circle at 50% 50%, #e5e5e5 0%, #a3a3a3 50%, #737373 100%);
            box-shadow: 0 0 15px rgba(255,255,255,0.3), inset -5px -5px 12px rgba(0,0,0,0.3);
            animation: moonPhase 4s ease-in-out infinite;
            position: relative;
        }

        .moon-crater {
            position: absolute;
            border-radius: 50%;
            box-shadow: inset 2px 2px 4px rgba(0,0,0,0.4);
        }

        .moon-crater.c1 { width: 10px; height: 10px; top: 20%; left: 30%; background: radial-gradient(circle, #a3a3a3 0%, #737373 100%); }
        .moon-crater.c2 { width: 14px; height: 14px; top: 50%; left: 55%; background: radial-gradient(circle, #a3a3a3 0%, #525252 100%); }
        .moon-crater.c3 { width: 8px; height: 8px; top: 65%; left: 25%; background: radial-gradient(circle, #d4d4d4 0%, #737373 100%); }

        .moon-shadow {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, transparent 40%);
        }

        .star {
            position: absolute;
            width: 3px;
            height: 3px;
            background: #fff;
            border-radius: 50%;
            animation: starTwinkle 2s ease-in-out infinite;
        }

        /* User item with planet background */
        .userItem.has-collection {
            position: relative;
            overflow: hidden;
        }

        .userItem .planet-bg {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0.5;
            pointer-events: none;
        }

        .userItem .planet-bg .planet-container {
            transform: scale(1.2);
        }

        .userItem.has-collection .userItem-content {
            position: relative;
            z-index: 2;
            background: linear-gradient(90deg, rgba(42,42,42,0.95) 0%, rgba(42,42,42,0.7) 100%);
            display: flex;
            align-items: center;
            gap: 15px;
            width: 100%;
            padding: 15px;
            border-radius: 12px;
        }

        @keyframes heartbeat {
            0%,
            100% {
                transform: scale(1);
            }
            10%,
            30% {
                transform: scale(1.1);
            }
            20%,
            40% {
                transform: scale(0.9);
            }
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        @keyframes newMessage {
            0% {
                transform: translateX(-50px) scale(0.8);
                opacity: 0;
            }
            60% {
                transform: translateX(10px) scale(1.05);
                opacity: 1;
            }
            80% {
                transform: translateX(-5px) scale(0.98);
            }
            100% {
                transform: translateX(0) scale(1);
                opacity: 1;
            }
        }

        @keyframes onlinePulse {
            0%,
            100% {
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
            }
            50% {
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 234, 255, 0.4);
            }
        }

        #loginForm,
        #mainDiv,
        #chatDiv {
            animation: slideInUp 0.5s ease-out !important;
            position: relative;
            overflow: hidden;
        }

        .modal-content {
            animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
        }

        #mainHeader {
            animation: slideInUp 0.4s ease-out !important;
        }

        .profile-pic {
            transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
            animation: pulseGlow 3s ease-in-out infinite !important;
        }

        button {
            position: relative;
            overflow: hidden;
            transform-style: preserve-3d;
        }

        button:active {
            transform: translateY(0) scale(0.95) !important;
        }

        button::before {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.5);
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
            z-index: 0;
        }

        button:active::before {
            width: 300px;
            height: 300px;
        }

        button * {
            position: relative;
            z-index: 1;
        }

        .userItem,
        .group-item {
            animation: slideInRight 0.3s ease-out !important;
            animation-fill-mode: both !important;
        }

        .userItem:nth-child(1) {
            animation-delay: 0.05s !important;
        }

        .userItem:nth-child(2) {
            animation-delay: 0.1s !important;
        }

        .userItem:nth-child(3) {
            animation-delay: 0.15s !important;
        }

        .userItem:nth-child(4) {
            animation-delay: 0.2s !important;
        }

        .userItem:nth-child(5) {
            animation-delay: 0.25s !important;
        }

        .userItem:nth-child(6) {
            animation-delay: 0.3s !important;
        }

        .userItem:nth-child(7) {
            animation-delay: 0.35s !important;
        }

        .userItem:nth-child(8) {
            animation-delay: 0.4s !important;
        }

        .group-item:nth-child(1) {
            animation-delay: 0.05s !important;
        }

        .group-item:nth-child(2) {
            animation-delay: 0.1s !important;
        }

        .group-item:nth-child(3) {
            animation-delay: 0.15s !important;
        }

        .group-item:nth-child(4) {
            animation-delay: 0.2s !important;
        }

        .group-item:nth-child(5) {
            animation-delay: 0.25s !important;
        }

        .userItem:hover,
        .group-item:hover {
            transform: scale(1.05) translateX(5px) !important;
            box-shadow: 0 8px 20px rgba(0, 234, 255, 0.3) !important;
        }

        .message {
            animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
            animation-fill-mode: both !important;
        }

        .my-message {
            animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
            transform-origin: right !important;
        }

        .other-message {
            animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
            transform-origin: left !important;
        }

        .badge {
            animation: heartbeat 1.5s ease-in-out infinite !important;
        }

        input:focus {
            animation: pulseGlow 1.5s ease-in-out !important;
            transform: scale(1.02) !important;
        }

        #settingsButton {
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
        }

        #settingsButton:hover {
            transform: rotate(90deg) scale(1.2) !important;
            color: #fff !important;
        }

        #incomingCallNotification {
            animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), shake 0.5s ease-in-out 0.6s !important;
        }

        #uploadMenu {
            animation: slideInUp 0.3s ease-out !important;
        }

        h4 {
            animation: fadeIn 0.5s ease-out !important;
        }

        #plusBtn:hover {
            transform: translateY(-2px) rotate(90deg) !important;
            box-shadow: 0 8px 20px rgba(0, 153, 0, 0.6) !important;
        }

        #sendButton:hover {
            transform: translateY(-2px) scale(1.05) !important;
        }

        #loginForm>*,
        #mainDiv>*,
        #chatDiv>* {
            position: relative;
            z-index: 1;
        }

        #localVideo,
        #remoteVideo {
            animation: fadeIn 0.5s ease-out !important;
        }

        .video-placeholder {
            animation: pulseGlow 2s ease-in-out infinite !important;
        }

        .group-select-item:active {
            transform: scale(0.98) !important;
        }

        #settingsModal,
        #createGroupModal {
            animation: fadeIn 0.3s ease-out !important;
        }

        #settingsModal .modal-content,
        #createGroupModal .modal-content {
            animation: slideInUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
        }

        .close-btn {
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
        }

        .close-btn:hover {
            transform: rotate(90deg) scale(1.3) !important;
            color: #ff4d4f !important;
        }

        #callButton,
        #muteButton,
        #videoButton,
        #screenShareButton {
            transition: all 0.3s ease !important;
        }

        #callButton:hover,
        #muteButton:hover,
        #videoButton:hover,
        #screenShareButton:hover {
            transform: translateY(-3px) scale(1.08) !important;
        }

        #hangupButton:hover {
            animation: shake 0.5s ease-in-out !important;
        }

        .participant-video-box {
            animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
        }

        .msg-profile-pic {
            transition: all 0.3s ease !important;
        }

        .msg-profile-pic:hover {
            transform: scale(1.2) rotate(5deg) !important;
        }

        .loading {
            position: relative;
        }

        .loading::after {
            content: "";
            position: absolute;
            top: 50%;
            right: 10px;
            width: 16px;
            height: 16px;
            margin-top: -8px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: #fff;
            animation: spin 0.6s linear infinite;
            z-index: 10;
        }

        #messages::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #00eaff, #0078ff);
            border-radius: 10px;
            transition: all 0.3s ease;
        }

        #messages::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, #00ffff, #0099ff);
            box-shadow: 0 0 10px rgba(0, 234, 255, 0.5);
        }

        .message.new-message {
            animation: newMessage 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
        }

        .userItem.online,
        .group-item.online {
            animation: onlinePulse 2s ease-in-out infinite !important;
        }

        #mainHeader,
        #loginForm,
        #mainDiv,
        #chatDiv {
            transform-style: preserve-3d;
        }

        .message img {
            transition: all 0.3s ease !important;
            cursor: pointer;
        }

        .message img:hover {
            transform: scale(1.05) !important;
            box-shadow: 0 10px 30px rgba(0, 234, 255, 0.5) !important;
        }

        body {
            background: linear-gradient(135deg, #121212 0, #1a1a1a 100%);
            color: #e0e0e0;
            font-family: "Open Sans", "Segoe UI", sans-serif;
            text-align: center;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            min-height: 100vh;
            direction: rtl;
        }

        #mainHeader {
            padding: 20px;
            background: rgba(18, 18, 18, 0.9);
            margin: 0;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
            font-weight: 700;
            font-size: 1.8em;
            color: #00eaff;
            position: sticky;
            top: 0;
            z-index: 10;
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        #mainHeader h2 {
            margin: 0;
            padding: 0;
            background: 0 0;
            box-shadow: none;
            font-size: 1.1em;
            flex-grow: 1;
        }

        #settingsButton {
            background: 0 0;
            color: #fd0;
            font-size: 1.5em;
            padding: 5px;
            margin: 0 10px 0 0;
            box-shadow: none;
            transition: color 0.2s ease;
            order: -1;
            display: none;
        }

        #settingsButton:hover {
            color: #fff;
            transform: none;
        }

        h4 {
            color: #fd0;
            margin-top: 20px;
            padding-bottom: 5px;
            border-bottom: 1px solid #333;
            width: 80%;
            margin-right: auto;
            margin-left: auto;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes iconPulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.1);
            }
        }

        @keyframes modalFadeOut {
            from {
                opacity: 1;
            }
            to {
                opacity: 0;
            }
        }

        @keyframes modalSlideOut {
            from {
                opacity: 1;
                transform: scale(1);
            }
            to {
                opacity: 0;
                transform: scale(0.9);
            }
        }

        #settingsModal {
            display: none;
            position: fixed;
            z-index: 100;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background: linear-gradient(135deg, rgba(0, 0, 0, 0.92), rgba(10, 15, 30, 0.94));
            backdrop-filter: blur(8px);
            padding-top: 50px;
        }

        #settingsModal.closing {
            animation: modalFadeOut 0.3s ease-out forwards;
        }

        #settingsModal.closing .modal-content {
            animation: modalSlideOut 0.3s ease-out forwards;
        }

        .modal-content {
            background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
            margin: 3% auto;
            padding: 0;
            border-radius: 24px;
            width: 92%;
            max-width: 700px;
            box-shadow: 0 20px 60px rgba(0, 120, 200, 0.15), 0 0 0 1px rgba(0, 150, 200, 0.08);
            position: relative;
            direction: inherit; /* Inherit from document */
            overflow: hidden;
            animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            display: flex;
        }

        /* LTR modal layout - sidebar on left */
        html[dir="ltr"] .modal-content,
        [dir="ltr"] .modal-content {
            flex-direction: row-reverse;
        }

        .modal-sidebar {
            width: 200px;
            background: rgba(0, 0, 0, 0.3);
            border-left: 1px solid rgba(255, 255, 255, 0.05);
            padding: 80px 0 20px 0;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .sidebar-item {
            padding: 15px 20px;
            color: rgba(255, 255, 255, 0.6);
            cursor: pointer;
            transition: all 0.3s ease;
            border-right: 3px solid transparent;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .sidebar-item:hover {
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.9);
        }

        .sidebar-item.active {
            background: rgba(0, 150, 200, 0.1);
            color: #00d4ff;
            border-right-color: #00d4ff;
        }

        .sidebar-item-icon {
            font-size: 1.2em;
            order: 0; /* Default: icon first (right side in RTL) */
        }

        /* RTL mode (Hebrew/Arabic) - icon on the right */
        html[dir="rtl"] .sidebar-item,
        [dir="rtl"] .sidebar-item {
            flex-direction: row;
            border-right: 3px solid transparent;
            border-left: none;
        }

        html[dir="rtl"] .sidebar-item.active,
        [dir="rtl"] .sidebar-item.active {
            border-right-color: #00d4ff;
            border-left-color: transparent;
        }

        html[dir="rtl"] .sidebar-item-icon,
        [dir="rtl"] .sidebar-item-icon {
            order: 0; /* Icon first in RTL (appears on right) */
            margin-left: 0;
            margin-right: 0;
        }

        /* LTR mode (English) - icon on the left */
        html[dir="ltr"] .sidebar-item,
        [dir="ltr"] .sidebar-item {
            flex-direction: row;
            border-left: 3px solid transparent;
            border-right: none;
        }

        html[dir="ltr"] .sidebar-item.active,
        [dir="ltr"] .sidebar-item.active {
            border-left-color: #00d4ff;
            border-right-color: transparent;
        }

        html[dir="ltr"] .sidebar-item-icon,
        [dir="ltr"] .sidebar-item-icon {
            order: -1; /* Icon first in LTR (appears on left) */
            margin-left: 0;
            margin-right: 0;
        }

        /* Modal sidebar border adjustment for LTR */
        html[dir="ltr"] .modal-sidebar,
        [dir="ltr"] .modal-sidebar {
            border-left: none;
            border-right: 1px solid rgba(255, 255, 255, 0.05);
        }

        .modal-main {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .modal-header {
            background: linear-gradient(135deg, rgba(0, 150, 200, 0.7), rgba(0, 100, 180, 0.7));
            padding: 24px 30px;
            position: relative;
            overflow: hidden;
        }

        .modal-header::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
            animation: rotate 20s linear infinite;
        }

        .modal-header h3 {
            color: #fff;
            margin: 0;
            font-size: 1.8em;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 12px;
            position: relative;
            z-index: 1;
        }

        .modal-header h3::before {
            content: '⚙️';
            font-size: 1.2em;
            animation: rotate 3s linear infinite;
        }

        .modal-body {
            padding: 30px;
            max-height: 70vh;
            overflow-y: auto;
        }

        .modal-body::-webkit-scrollbar {
            width: 8px;
        }

        .modal-body::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 10px;
        }

        .modal-body::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #00eaff, #0078ff);
            border-radius: 10px;
        }

        .settings-section {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(100, 150, 180, 0.15);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 20px;
            transition: all 0.3s ease;
            animation: slideDown 0.5s ease-out;
            display: none;
        }

        .settings-section.active {
            display: block;
        }

        .settings-section:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(0, 180, 220, 0.25);
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 150, 200, 0.12);
        }

        .section-title {
            color: #00d4ff;
            font-size: 1.1em;
            font-weight: 700;
            margin: 0 0 15px 0;
            padding-bottom: 10px;
            border-bottom: 2px solid rgba(0, 180, 220, 0.2);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .section-icon {
            font-size: 1.3em;
            animation: iconPulse 2s ease-in-out infinite;
        }

        .close-btn {
            position: absolute;
            left: 20px;
            top: 24px;
            color: rgba(255, 255, 255, 0.9);
            font-size: 32px;
            font-weight: 700;
            cursor: pointer;
            z-index: 2;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }

        .close-btn:hover {
            background: rgba(255, 77, 79, 0.2);
            transform: rotate(90deg) scale(1.1);
            color: #ff4d4f;
        }

        .modal-content input[type="text"],
        .modal-content input[type="password"],
        .modal-content input[type="color"],
        .modal-content input[type="file"] {
            width: 100%;
            padding: 14px 16px;
            margin-bottom: 12px;
            border-radius: 12px;
            border: 2px solid rgba(0, 234, 255, 0.2);
            background: rgba(0, 0, 0, 0.3);
            color: #fff;
            font-size: 1em;
            transition: all 0.3s ease;
            box-sizing: border-box;
        }

        .modal-content input:focus {
            outline: none;
            border-color: #00d4ff;
            background: rgba(0, 180, 220, 0.05);
            box-shadow: 0 0 0 4px rgba(0, 180, 220, 0.08);
            transform: scale(1.02);
        }

        .modal-content button {
            width: 100%;
            padding: 14px 20px;
            margin-bottom: 0;
            border: none;
            border-radius: 12px;
            background: linear-gradient(135deg, #0078ff, #00a8cc);
            color: #fff;
            font-size: 1em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 120, 200, 0.25);
            position: relative;
            overflow: hidden;
        }

        .modal-content button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s ease;
        }

        .modal-content button:hover::before {
            left: 100%;
        }

        .modal-content button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 150, 200, 0.4);
        }

        .modal-content button:active {
            transform: translateY(0) scale(0.98);
        }

        .color-picker-container {
            display: flex;
            gap: 12px;
            align-items: center;
            margin-bottom: 15px;
        }

        .color-picker-container input[type="color"] {
            width: 70px;
            height: 50px;
            border-radius: 12px;
            cursor: pointer;
            border: 3px solid rgba(0, 150, 200, 0.25);
            padding: 0;
            margin: 0;
        }

        .color-picker-container button {
            flex: 1;
            margin: 0;
        }

        .file-input-wrapper {
            position: relative;
            margin-bottom: 15px;
        }

        .file-input-wrapper input[type="file"] {
            padding: 12px;
            cursor: pointer;
            background: rgba(0, 150, 200, 0.05);
            border: 2px dashed rgba(0, 150, 200, 0.25);
        }

        .file-input-wrapper input[type="file"]:hover {
            background: rgba(0, 150, 200, 0.1);
            border-color: rgba(0, 150, 200, 0.4);
        }

        .reset-button {
            background: linear-gradient(135deg, #ff4d4f, #ff7875) !important;
            box-shadow: 0 4px 15px rgba(255, 77, 79, 0.3) !important;
        }

        .reset-button:hover {
            box-shadow: 0 6px 20px rgba(255, 77, 79, 0.5) !important;
        }

        #settingsMessage {
            color: #00d4ff;
            margin-top: 15px;
            padding: 12px;
            background: rgba(0, 180, 220, 0.1);
            border-radius: 10px;
            border-right: 4px solid #00d4ff;
            font-weight: 600;
            animation: slideInRight 0.5s ease-out;
        }

        #chatDiv,
        #loginForm,
        #mainDiv {
            display: none;
            width: 90%;
            max-width: 500px;
            background: #1e1e1e;
            border-radius: 20px;
            padding: 25px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.05);
            margin-top: 20px;
            margin-bottom: 20px;
        }

        input {
            width: 80%;
            padding: 12px 15px;
            margin-top: 10px;
            border-radius: 10px;
            border: 1px solid #3a3a3a;
            outline: 0;
            background: #2b2b2b;
            color: #fff;
            font-size: 1em;
            transition: all 0.3s ease;
        }

        input:focus {
            border-color: #00eaff;
            box-shadow: 0 0 8px rgba(0, 234, 255, 0.5);
        }

        button {
            padding: 12px 25px;
            border: none;
            border-radius: 10px;
            background: #0078ff;
            color: #fff;
            cursor: pointer;
            margin: 5px;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 4px 10px rgba(0, 120, 255, 0.3);
        }

        button:hover {
            background: #39f;
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(0, 120, 255, 0.5);
        }

        .profile-pic {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            margin-top: 15px;
            border: 3px solid #00eaff;
            object-fit: cover;
            box-shadow: 0 0 10px rgba(0, 234, 255, 0.5);
        }

        #friendsList {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 15px;
            gap: 10px;
        }

        .userItem {
            background: #2a2a2a;
            padding: 15px;
            border-radius: 12px;
            width: 90%;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 15px;
            position: relative;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
            transition: all 0.2s ease;
        }

        .userItem:hover {
            background: #363636;
            transform: scale(1.02);
        }

        .username {
            font-weight: 700;
            color: #fd0;
            font-size: 1.1em;
            flex-grow: 1;
            text-align: right;
        }

        .badge {
            background: #ff4d4f;
            color: #fff;
            border-radius: 15px;
            padding: 4px 8px;
            font-size: 0.8em;
            min-width: 30px;
            text-align: center;
            font-weight: 700;
            box-shadow: 0 0 5px rgba(255, 77, 79, 0.5);
        }

        .group-item {
            background: #2a2a2a;
            padding: 15px;
            border-radius: 12px;
            width: 90%;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 15px;
            position: relative;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
            transition: all 0.2s ease;
        }

        .group-item:hover {
            background: #363636;
            transform: scale(1.02);
        }

        .group-item .username {
            font-weight: 700;
            color: #00eaff;
            font-size: 1.1em;
            flex-grow: 1;
            text-align: right;
        }

        .group-select-item {
            background: #2a2a2a;
            padding: 10px 15px;
            border-radius: 12px;
            width: 90%;
            margin-bottom: 10px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 15px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
            transition: all 0.2s ease;
        }

        .group-select-item:hover {
            background: #363636;
            transform: scale(1.01);
        }

        .group-select-item input[type="checkbox"] {
            width: 20px;
            height: 20px;
            margin: 0;
            accent-color: #00eaff;
            cursor: pointer;
        }

        .group-select-item .username {
            flex-grow: 1;
        }

        #chatDiv {
            padding: 20px;
        }

        #chatHeader {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding: 10px;
            border-bottom: 1px solid #333;
        }

        #callButton {
            padding: 8px 15px;
            background: #0c0;
            box-shadow: 0 4px 10px rgba(0, 204, 0, 0.4);
            font-size: 1em;
            margin: 0 5px;
            display: none;
        }

        #callButton:hover {
            background: #0f0;
        }

        #callArea {
            height: auto;
            min-height: 250px;
            border: 1px solid #00eaff;
            border-radius: 15px;
            width: 95%;
            margin: 15px auto;
            padding: 10px;
            background: rgba(0, 234, 255, 0.1);
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: space-around;
            gap: 10px;
            position: relative;
        }

        .video-container {
            position: relative;
            width: 100%;
            display: flex;
            justify-content: space-around;
            align-items: center;
            gap: 10px;
        }

        #localVideo,
        #remoteVideo,
        .video-placeholder {
            width: 48%;
            max-width: 200px;
            height: 200px;
            min-height: 200px;
            border-radius: 10px;
            background: #000;
            border: 2px solid #fd0;
            object-fit: cover;
            transition: all 0.3s ease;
        }

        .group-video-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            width: 95%;
            margin: 0 auto;
            padding: 10px;
        }

        .group-video-grid.three-participants {
            grid-template-columns: repeat(2, 1fr);
        }

        .group-video-grid.four-participants {
            grid-template-columns: repeat(2, 1fr);
        }

        .group-video-grid.five-plus {
            grid-template-columns: repeat(3, 1fr);
        }

        .participant-video-box {
            position: relative;
            width: 100%;
            aspect-ratio: 1;
            border-radius: 15px;
            overflow: hidden;
            background: #1a1a1a;
            border: 3px solid #00eaff;
            box-shadow: 0 5px 15px rgba(0, 234, 255, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .participant-video-box.local-user {
            border-color: #fd0;
        }

        .participant-video-box video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transform: scaleX(-1);
        }

        .participant-video-box img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .participant-video-box .participant-name {
            position: absolute;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.8);
            color: #fff;
            padding: 5px 15px;
            border-radius: 20px;
            font-size: 0.9em;
            font-weight: 700;
            z-index: 10;
            white-space: nowrap;
        }

        .participant-video-box.local-user .participant-name {
            background: rgba(255, 221, 0, 0.9);
            color: #121212;
        }

        #remoteVideo {
            transform: scaleX(-1);
            display: none;
            border-color: #fd0 !important;
        }

        #localVideo {
            transform: scaleX(-1);
            display: none;
            border-color: #00eaff !important;
        }

        .video-placeholder {
            object-fit: cover;
            background: 0 0;
            display: none;
        }

        .circular-mode {
            border-radius: 10px !important;
            transform: none !important;
            width: 48%;
            height: 200px;
            min-height: 200px;
        }

        #remotePlaceholder {
            border-color: #fd0 !important;
        }

        #localPlaceholder {
            border-color: #00eaff !important;
        }

        #messages {
            height: 400px;
            overflow-y: auto;
            border: 1px solid #333;
            border-radius: 15px;
            width: 95%;
            margin: 15px auto;
            padding: 10px;
            background: rgba(0, 0, 0, 0.2);
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .chat-active #messages {
            height: 150px;
        }

        .message {
            padding: 7px 15px;
            border-radius: 15px;
            max-width: 85%;
            position: relative;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            word-wrap: break-word;
            display: flex;
            align-items: flex-start;
        }

        .my-message {
            align-self: flex-end;
            background: #0078ff;
            color: #fff;
            border-bottom-right-radius: 15px;
            border-bottom-left-radius: 0;
            flex-direction: row-reverse;
        }

        .other-message {
            align-self: flex-start;
            background: #3a3a3a;
            color: #f0f0f0;
            border-bottom-right-radius: 0;
            flex-direction: row;
        }

        .msg-profile-pic {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
            border: 1px solid #fd0;
            align-self: flex-start;
        }

        .other-message .msg-profile-pic {
            margin-left: 10px;
        }

        .my-message .msg-profile-pic {
            margin-right: 10px;
            border: 1px solid #ffeb3b;
        }

        .message-content-wrapper {
            display: flex;
            flex-direction: column;
            text-align: right;
            flex-grow: 1;
        }

        .message .username {
            display: inline;
            font-size: 0.9em;
            font-weight: 700;
            margin-bottom: 3px;
            color: #fd0;
        }

        .my-message .username {
            color: #ffeb3b !important;
        }

        .message .text-body {
            margin-top: 5px;
            font-size: 1em;
        }

        .message img {
            max-width: 100%;
            height: auto;
            border-radius: 10px;
            margin-top: 5px;
        }

        .message button {
            padding: 5px;
            margin: 0;
            margin-right: 5px;
            background: 0 0;
            box-shadow: none;
            font-size: 1.1em;
        }

        #chatInputArea {
            display: flex;
            justify-content: center;
            align-items: flex-end;
            gap: 0;
            margin-top: 15px;
            width: 100%;
        }

        #msgInput {
            flex-grow: 1;
            width: auto;
            margin: 0;
            border-radius: 0;
        }

        #chatInputArea button {
            height: 44px;
            padding: 12px;
            margin: 0;
            border-radius: 0;
            box-shadow: 0 4px 10px rgba(0, 120, 255, 0.3);
        }

        #sendButton {
            border-top-left-radius: 10px;
            border-bottom-left-radius: 10px;
        }

        #plusBtn {
            border-top-right-radius: 0px;
            border-bottom-right-radius: 10px;
            padding: 12px 15px;
            background: #090;
            box-shadow: 0 4px 10px rgba(0, 153, 0, 0.4);
        }

        #plusBtn:hover {
            background: #0c0;
        }

        /* ============================================
           רספונסיביות למסכים קטנים (טלפונים)
           ============================================ */
        @media (max-width: 600px) {
            /* מודל הגדרות במסך מלא */
            #settingsModal.closing {
                transform: translateY(100%);
            }

            #settingsModal .modal-content {
                width: 100vw;
                height: 100vh;
                border-radius: 0;
                max-width: none;
                flex-direction: column;
                overflow: hidden;
            }

            /* סרגל הצד - הצגה כטאבים בחלק העליון */
            .modal-sidebar {
                width: 100%;
                height: auto;
                border-bottom: 1px solid rgba(255, 255, 255, 0.05);
                border-left: none;
                padding: 0;
                order: 1;
                overflow-x: auto;
                overflow-y: hidden;
                white-space: nowrap;
                flex-direction: row;
                flex-shrink: 0;
            }
            
            .sidebar-item {
                display: inline-flex;
                padding: 12px 20px;
                margin: 0;
                border-bottom: 3px solid transparent;
                border-right: none;
                background-color: transparent;
                font-size: 14px;
            }
            
            .sidebar-item.active {
                border-bottom-color: #00eaff;
                background-color: rgba(0, 234, 255, 0.1);
                border-right: none;
            }
            
            /* תוכן ראשי */
            .modal-main {
                width: 100%;
                order: 2;
                overflow-y: auto;
            }
            
            .modal-header {
                padding: 20px 15px;
            }
            
            .modal-body {
                padding: 20px 15px;
            }
            
            /* כפתור סגירה */
            .close-btn {
                left: 10px;
                top: 20px;
            }
        }

        /* התאמות נוספות למסכים ממש קטנים */
        @media (max-width: 400px) {
            .sidebar-item {
                padding: 10px 15px;
                font-size: 13px;
            }
            
            .modal-body {
                padding: 15px 10px;
            }
            
            .modal-header h3 {
                font-size: 1.5em;
            }
        }

@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* ============================================
   CREATE GROUP MODAL - REDESIGNED
   ============================================ */

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes friendItemSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulseCheck {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.create-group-overlay {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: overlayFadeIn 0.3s ease-out;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.create-group-overlay.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
}

.create-group-modal {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(0, 234, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 234, 255, 0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.create-group-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00eaff, #00ff88, #00eaff);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.create-group-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
    box-shadow: none;
}

.create-group-close:hover {
    background: rgba(255, 77, 79, 0.2);
    border-color: rgba(255, 77, 79, 0.5);
    color: #ff4d4f;
    transform: rotate(90deg);
}

.create-group-header {
    padding: 40px 30px 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.create-group-icon {
    font-size: 3em;
    margin-bottom: 16px;
    display: inline-block;
    animation: pulseCheck 2s ease-in-out infinite;
}

.create-group-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 10px rgba(0, 234, 255, 0.3);
}

.create-group-subtitle {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.create-group-body {
    padding: 25px 30px;
}

.create-group-input-wrapper,
.create-group-search-wrapper {
    margin-bottom: 20px;
}

.create-group-label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-align: right;
}

.create-group-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.create-group-input:focus {
    border-color: #00eaff;
    background: rgba(0, 234, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 234, 255, 0.2);
}

.create-group-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.create-group-search {
    position: relative;
    display: flex;
    align-items: center;
}

.create-group-search .search-icon {
    position: absolute;
    right: 14px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.create-group-search-input {
    width: 100%;
    padding: 14px 48px 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.create-group-search-input:focus {
    border-color: #00eaff;
    background: rgba(0, 234, 255, 0.05);
}

.create-group-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.create-group-selected-count {
    text-align: center;
    font-size: 0.9em;
    color: #00eaff;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 8px 16px;
    background: rgba(0, 234, 255, 0.1);
    border-radius: 20px;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

.create-group-friends-list {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 234, 255, 0.3) transparent;
}

.create-group-friends-list::-webkit-scrollbar {
    width: 6px;
}

.create-group-friends-list::-webkit-scrollbar-track {
    background: transparent;
}

.create-group-friends-list::-webkit-scrollbar-thumb {
    background: rgba(0, 234, 255, 0.3);
    border-radius: 10px;
}

.group-friend-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    border-radius: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: friendItemSlide 0.4s ease-out backwards;
}

.group-friend-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 234, 255, 0.3);
    transform: translateX(-5px);
}

.group-friend-item.selected {
    background: linear-gradient(135deg, rgba(0, 234, 255, 0.15) 0%, rgba(0, 255, 136, 0.1) 100%);
    border-color: #00eaff;
    box-shadow: 0 0 20px rgba(0, 234, 255, 0.2);
}

.group-friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.group-friend-item.selected .group-friend-avatar {
    border-color: #00eaff;
    box-shadow: 0 0 15px rgba(0, 234, 255, 0.4);
}

.group-friend-info {
    flex: 1;
    text-align: right;
}

.group-friend-name {
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
}

.group-friend-status {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.4);
}

.group-friend-checkbox {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.group-friend-item.selected .group-friend-checkbox {
    background: linear-gradient(135deg, #00eaff 0%, #00ff88 100%);
    border-color: transparent;
    animation: pulseCheck 0.4s ease-out;
}

.group-friend-checkbox svg {
    width: 16px;
    height: 16px;
    stroke: #121212;
    stroke-width: 3;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.group-friend-item.selected .group-friend-checkbox svg {
    opacity: 1;
}

.create-group-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.create-group-cancel {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
}

.create-group-cancel:hover {
    background: rgba(255, 77, 79, 0.1);
    border-color: rgba(255, 77, 79, 0.5);
    color: #ff4d4f;
}

.create-group-submit {
    flex: 2;
    padding: 14px 24px;
    background: linear-gradient(135deg, #00eaff 0%, #00cc88 100%);
    border: none;
    border-radius: 14px;
    color: #121212;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 234, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.create-group-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.create-group-submit:hover::before {
    left: 100%;
}

.create-group-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 234, 255, 0.5);
}

.create-group-submit:active {
    transform: translateY(-1px);
}

.group-friends-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.group-friends-empty-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 520px) {
    .create-group-overlay.active {
        padding: 10px;
        padding-top: 20px;
    }
    
    .create-group-modal {
        border-radius: 20px;
    }
    
    .create-group-header {
        padding: 30px 20px 25px;
    }
    
    .create-group-icon {
        font-size: 2.5em;
    }
    
    .create-group-title {
        font-size: 1.5em;
    }
    
    .create-group-body {
        padding: 20px;
    }
    
    .create-group-footer {
        padding: 15px 20px 25px;
        flex-direction: column;
    }
    
    .create-group-cancel,
    .create-group-submit {
        flex: none;
        width: 100%;
    }
}

/* ============================================================ */
/* תיקון באג: תפריט פלוס ב-LTR */
/* ============================================================ */

#mainPlusMenu {
    position: absolute;
    bottom: 80px; /* הגובה מעל שורת ההקלדה */
    
    /* התיקון: משתמש ב-inset-inline-start כדי להיצמד לצד ה"התחלה" של השפה */
    /* בעברית (RTL) זה יהיה ימין. באנגלית (LTR) זה יהיה שמאל. */
    inset-inline-start: 15px;
    
    /* איפוס הגדרות ימין/שמאל קודמות אם יש */
    left: auto;
    right: auto;

    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    
    /* מוודא שהאנימציה יוצאת מהפינה הנכונה */
    transform-origin: bottom inset-inline-start;
}

/* ודא שגם אזור ההקלדה מכבד את כיוון השפה */
#chat-input-area {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px 0;
    /* *חשוב*: ודא שאין כאן direction: rtl; קשיח. 
       הכיוון צריך לרשת מה-<html> או <body> */
}