:root {
    --chat-bg-opacity: 1;
    --chat-backdrop-blur: 0px;
    --chat-bg-color-base: 0, 0, 0;
    --glass-bg-opacity: 1;
    --glass-blur: 0px;
}

#chatDiv {
    background: rgba(30, 30, 30, var(--glass-bg-opacity)) !important;
    backdrop-filter: blur(var(--glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) !important;
    transition: background 0.3s, backdrop-filter 0.3s;
}

#messages {
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#chatInputArea {
    background: transparent !important;
}

html {
    background-color: #121212;
    overflow-x: hidden;
    width: 100%;
    min-height: 100%;
}

body {
    background: linear-gradient(135deg, #121212 0, #1a1a1a 100%);
    color: #e0e0e0;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    text-align: center;
    direction: rtl;

    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

@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);
        }
    }


    @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 {
        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);
        color: #aaa;
        width: 100%;
        margin-bottom: 15px;
    }

    .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: rotate 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: rotate 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, rotate 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;
    }

    .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;
        position: relative;
        overflow: visible;
    }

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

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

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

    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;
        animation-fill-mode: both;
    }

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

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

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

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

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

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

    #incomingCallNotification {
        animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

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

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

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

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

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

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

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

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

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

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

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

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

    .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;
    }

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

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

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

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

    #mainHeader {
        animation: slideInUp 0.4s ease-out;
        transform-style: preserve-3d;
        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: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        order: -1;
        display: none;
    }

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

    h4 {
        animation: fadeIn 0.5s ease-out;
        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;
        overflow: hidden;
        animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        display: flex;
    }

    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;
    }

    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="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;
        margin-left: 0;
        margin-right: 0;
    }

    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);
    }

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

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

    #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;
        position: relative;
        z-index: 10;
    }

    .userItem,
    .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;
    }

    .userItem:hover,
    .group-item: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 .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;
        position: relative;
    z-index: 20;
    }

    #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: auto;
        border: 1px solid #00eaff;
        border-radius: 15px;
        width: 95%;
        margin: 15px auto;
        padding: 6px;
        background: rgba(0, 234, 255, 0.1);
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: space-around;
        gap: 10px;
        position: relative;
        
    }

    .video-placeholder {
        width: 100%;
        max-width: 160px;
        aspect-ratio: 1 / 1;
        height: 100%;
        max-height: 160px;
        min-height: unset;
        border-radius: 10px;
        background: #000;
        border: 2px solid #fd0;
        object-fit: cover;
        transition: all 0.3s ease;
        margin: 0 auto;
    }

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

    .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;
    }

    #messages {
        height: 400px;
        overflow-y: auto;
        border: 1px solid #333;
        border-radius: 15px;
        width: 95%;
        margin: 15px auto;
        padding: 10px;
        background: rgba(var(--chat-bg-color-base), var(--chat-bg-opacity));
        transition: background-color 0.3s, backdrop-filter 0.3s;
        display: flex;
        flex-direction: column;
        gap: 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    #messages::-webkit-scrollbar {
        display: none;
    }

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

    .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-inline-end: 10px;
    }

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

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

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

    .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; } }

@keyframes modalSlideIn {
    from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    }
    to {
    opacity: 1;
    transform: translateY(0) scale(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: fadeIn 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;
}

@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%;
    }
}

#mainPlusMenu {
    position: absolute;
    bottom: 80px;

    inset-inline-start: 15px;

    left: auto;
    right: auto;

    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;

    transform-origin: bottom inset-inline-start;
}

.mute-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 38, 38, 0.85);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mute-indicator.active,
.mute-indicator.local-active {
    opacity: 1;
    animation: bounceIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.friend-request-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.friend-request-card:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.3) 100%);
    border-color: rgba(0, 234, 255, 0.2);
    transform: translateY(-2px);
}

.friend-request-card::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #00eaff, #0078ff);
    left: 0;
    opacity: 0.7;
}

html[dir="rtl"] .friend-request-card::before,
body[dir="rtl"] .friend-request-card::before {
    left: auto;
    right: 0;
}

.req-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}

.req-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 234, 255, 0.5);
    box-shadow: 0 0 8px rgba(0, 234, 255, 0.2);
}

.req-name {
    font-weight: 600;
    font-size: 1.1em;
    color: #e0e0e0;
    letter-spacing: 0.5px;
}

.req-actions {
    display: flex;
    gap: 12px;
}

.req-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2em;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    color: white;
}

.req-btn.accept {
    background: linear-gradient(135deg, #00b09b, #96c93d);
}

.req-btn.accept:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 15px rgba(150, 201, 61, 0.4);
}

.req-btn.reject {
    background: linear-gradient(135deg, #cb2d3e, #ef473a);
}
.req-btn.reject:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 15px rgba(239, 71, 58, 0.4);
}

.req-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 3;
    stroke: currentColor;
    fill: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.empty-requests {
    text-align: center;
    color: rgba(255,255,255,0.3);
    padding: 40px 20px;
    font-size: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-requests-icon {
    font-size: 3.5em;
    opacity: 0.2;
    margin-bottom: 5px;
    filter: grayscale(100%);
}

.friend-dropdown {
    display: none;
    position: absolute;
    top: 40px;
    inset-inline-start: 10px;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    z-index: 9999;
    min-width: 140px;
    padding: 5px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.9);
    animation: fadeIn 0.2s ease-out;
}

.userItem,
    .group-item {
    position: relative;
    overflow: visible;
    transition: z-index 0.1s;
}

.friend-dropdown > div {
    padding: 8px;
    color: #ff4d4f;
    cursor: pointer;
    text-align: right;
    transition: background 0.2s ease;
}

.friend-dropdown > div:hover {
    background: rgba(255, 77, 79, 0.2);
    border-radius: 6px;
}

.planet-bg-mask {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.userItem .userItem-content {
    position: relative;
    z-index: 2;
}

.security-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    flex-shrink: 0;
}

.security-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.security-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a3a;
    transition: 0.4s;
    border-radius: 32px;
    border: 2px solid #555;
}

.security-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background-color: #888;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.security-toggle input:checked + .security-toggle-slider {
    background: linear-gradient(135deg, #00eaff 0%, #00cc88 100%);
    border-color: #00eaff;
    box-shadow: 0 0 15px rgba(0, 234, 255, 0.4);
}

.security-toggle input:checked + .security-toggle-slider:before {
    transform: translateX(28px);
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 234, 255, 0.5);
}

.security-toggle input:focus + .security-toggle-slider {
    box-shadow: 0 0 3px rgba(0, 234, 255, 0.5);
}

.security-toggle-slider:before {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.3s ease,
        box-shadow 0.3s ease;
}

.security-toggle input:checked + .security-toggle-slider:after {
    content: "🔒";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.8;
}

.mic-switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mic-switch-container .switch {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #444;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mic-on, .mic-off {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all .3s ease-in-out;
}

.mic-on { z-index: 4; }
.mic-off {
    position: absolute;
    inset: 0;
    z-index: 5;
    opacity: 0;
}

.mic-switch-container .switch:hover {
    background-color: #555;
    transform: scale(1.05);
}

#mic-checkbox { display: none; }

#mic-checkbox:checked + .switch,
.mic-switch-container #mic-checkbox:checked + .switch {
    background-color: #ff4444;
}

#mic-checkbox:checked + .switch .mic-off {
    opacity: 1;
}

#mic-checkbox:active + .switch,
.mic-switch-container #mic-checkbox:active + .switch {
    transform: scale(1.2);
}

.participant-mic-status {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
}
@keyframes bubblePop {
    0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.3);
    box-shadow: 0 0 0 rgba(0, 234, 255, 0);
    }
    60% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 234, 255, 0.5), 0 10px 20px rgba(0, 0, 0, 0.8);
    }
    80% {
    transform: translate(-50%, 0) scale(0.95);
    box-shadow: 0 10px 25px rgba(0, 234, 255, 0.3), 0 5px 10px rgba(0, 0, 0, 0.6);
    }
    100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    box-shadow: 0 15px 30px rgba(0, 234, 255, 0.4), 0 8px 15px rgba(0, 0, 0, 0.7);
    }
}

#incomingCallNotification,
#incoming-group-call-modal {
    animation: bubblePop 0.4s ease-out forwards;
}

.layout-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.layout-btn {
    background: #1e1e1e;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    width: 140px;
}

.layout-btn.active {
    border-color: #00eaff;
    box-shadow: 0 0 15px rgba(0, 234, 255, 0.2);
}

.layout-btn span {
    margin-top: 10px;
    font-weight: bold;
    font-size: 0.9em;
}

.mockup-ui {
    width: 80px;
    height: 100px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    padding: 6px;
    box-sizing: border-box;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.mockup-bubble {
    height: 10px;
    border-radius: 6px;
    margin-bottom: 4px;
}
.mockup-bubble.left {
    width: 60%;
    background: #e0e0e0;
    align-self: flex-start;
}
.mockup-bubble.right {
    width: 50%;
    background: #00eaff;
    align-self: flex-end;
}

.mockup-classic {
    flex-direction: column;
    justify-content: flex-end;
}

.mockup-split {
    flex-direction: row;
    gap: 4px;
}
.mockup-sidebar {
    width: 30%;
    height: 100%;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px;
}
.mockup-line {
    height: 4px;
    background: #ccc;
    border-radius: 2px;
}
.mockup-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

@media (min-width: 768px) {
    body.layout-split {
    overflow: hidden !important;
    gap: 20px;
    align-items: stretch;
    }

    body.layout-split #mainHeader {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 75px;
    z-index: 9999 !important;
    box-sizing: border-box;
    }

    body.layout-split #mainDiv {
    position: fixed !important;
    top: 75px !important;
    width: 300px !important;
    height: calc(100vh - 75px) !important;
    display: flex !important;
    flex-direction: column;
    z-index: 10;
    overflow-y: auto;
    background: rgba(18, 18, 18, 0.6) !important;
    backdrop-filter: blur(12px);

    margin: 0 !important;
    border-radius: 0 !important;
    padding-bottom: 20px;
    }

    body.layout-split #chatDiv {
    position: fixed !important;
    top: 75px !important;
    height: calc(100vh - 95px) !important;
    max-width: none !important;
    width: calc(100vw - 350px) !important;
    z-index: 5;
    margin: 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
    display: flex !important;
    flex-direction: column;
    background: rgba(30, 30, 30, 0.5) !important;
    backdrop-filter: blur(12px);
    }

    body.layout-split #messages {
    flex-grow: 1 !important;
    height: auto !important;
    max-height: none !important;
    }

    html[dir="rtl"] body.layout-split #mainDiv {
    right: 0;
    background-color: #161616 !important;
    border-left: 1px solid rgba(0, 234, 255, 0.15) !important;
    box-shadow: -4px 0 20px rgba(0,0,0,0.3) !important;
    }
    html[dir="rtl"] body.layout-split #chatDiv {
    right: 316px !important;
    left: 12px !important;
    }

    html[dir="ltr"] body.layout-split #mainDiv {
    left: 0;
    background-color: #161616 !important;
    border-right: 1px solid rgba(0, 234, 255, 0.15) !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3) !important;
    }
    html[dir="ltr"] body.layout-split #chatDiv {
    left: 316px !important;
    right: 12px !important;
    }
}

body.layout-split #mainDiv {
    align-items: center !important;
    overflow-y: auto !important;
    padding-bottom: 40px !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

body.layout-split #userPic {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
    width: 70px !important;
    height: 70px !important;
    min-height: 70px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
}

body.layout-split #callArea {
    max-height: 45vh !important;
    overflow-y: auto !important;
    flex-shrink: 0 !important;
}

body.layout-split .group-video-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 180px)) !important;
    justify-content: center !important;
    gap: 49px !important;
    padding: 10px !important;
}
body.layout-split .participant-video-box {
    max-height: 180px !important;
    max-width: 180px !important;
    margin: 0 auto !important;
}

body.layout-split #groupsList,
body.layout-split #friendsList {
    width: 100% !important;
}

body.layout-split #mainDiv > button {
    width: 90% !important;
    flex-shrink: 0 !important;
    min-height: 48px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 15px !important;
    display: block !important;
}

.empty-chat-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background-color: transparent;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
}

body.layout-split.no-active-chat .empty-chat-state {
    display: flex;
}

body.layout-split.no-active-chat #chatHeader,
body.layout-split.no-active-chat #callArea,
body.layout-split.no-active-chat #messages,
body.layout-split.no-active-chat #chatInputArea,
body.layout-split.no-active-chat button[onclick*="back()"] {
    display: none !important;
}

.waving-emoji {
    font-size: 100px;
    animation: wave-animation 2.5s infinite;
    transform-origin: 70% 70%;
}

.empty-chat-text {
    color: #00eaff;
    font-size: 1.5rem;
    margin-top: 20px;
    font-weight: 600;
    text-align: center;
}

@keyframes wave-animation {
    0%   { transform: rotate(0.0deg) }
    10%  { transform: rotate(14.0deg) }
    20%  { transform: rotate(-8.0deg) }
    30%  { transform: rotate(14.0deg) }
    40%  { transform: rotate(-4.0deg) }
    50%  { transform: rotate(10.0deg) }
    60%  { transform: rotate(0.0deg) }
    100% { transform: rotate(0.0deg) }
}

body.layout-split #callArea:has(#screenShareArea[style*="block"]),
body.layout-split #callArea:has(#remoteScreenShareArea[style*="block"]) {
    max-height: 75vh !important;
}

body.layout-split #screenShareArea,
body.layout-split #remoteScreenShareArea {
    width: fit-content !important;
    max-width: 100% !important;
    background: transparent !important;
    border: none !important;
    margin: 6px auto !important;
    padding: 0 !important;
    overflow: visible !important;
}

body.layout-split #screenShareArea video#localScreenVideo,
body.layout-split #remoteScreenShareArea video#remoteScreenVideo {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 320px !important;
    display: block !important;
    border-radius: 10px !important;
}

body.layout-split #screenShareArea video#localScreenVideo {
    border: 1px solid #00eaff !important;
}

body.layout-split #remoteScreenShareArea video#remoteScreenVideo {
    border: 1px solid #fd0 !important;
}

body.layout-split #hangupButton {
    flex-shrink: 0 !important;
}

body.layout-split #chatHeader {
    padding-right: 35px !important;
    padding-left: 35px !important;
}

body.layout-split #chatInputArea {
   max-width: 96.5%;
    margin: 0 auto;
}

body.layout-split #backButton {
    width: 150px !important;
    margin: 15px auto !important;
    align-self: center !important;
    border-radius: 20px !important;
}

#backButton {
    flex-shrink: 0;
    min-height: 48px;
}

.profile-modal-content img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00eaff;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(0, 234, 255, 0.4);
    transition: transform 0.3s ease;
}

.profile-modal-content img:hover {
    transform: scale(1.05);
}

.message img.msg-profile-pic {
    cursor: pointer;
}

.profile-modal-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #00eaff;
    border-radius: 24px;
    width: 380px;
    min-height: 400px;
    height: auto;
    padding: 0 0 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 234, 255, 0.2);
    animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-modal-content img#profileModalPic {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #16213e;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.profile-modal-content h3 {
    margin-top: 10px;
    color: #fff;
    font-size: 1.5em;
}

.banner-tools {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}
.banner-tool-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8em;
    cursor: pointer;
}

.camera-toggle {
    position: relative;
    width: 50px;
    height: 50px;
    display: inline-block;
}

.camera-toggle input {
    display: none;
}

.camera-toggle .btn {
    width: 100%;
    height: 100%;
    background-color: #444;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: none;
    outline: none;
}

.camera-toggle .btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.camera-toggle .btn:hover {
    background-color: #555;
    transform: scale(1.05);
}

.camera-toggle .btn:active {
    transform: scale(0.95);
}

.camera-toggle input:checked + .btn {
    background-color: #00eaff;
    box-shadow: 0 0 15px rgba(0, 234, 255, 0.4);
}

.camera-toggle input:checked + .btn svg {
    stroke: #121212;
}

.camera-toggle .slash {
    transition: opacity 0.2s ease, transform 0.3s ease;
    opacity: 1;
    transform-origin: center;
}

.camera-toggle input:checked + .btn .slash {
    opacity: 0;
    transform: scale(0);
}

.msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
    width: fit-content;
}
.my-message .msg-header {
    flex-direction: row-reverse;
    justify-content: flex-start;
    margin-inline-start: auto;
}

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

.message-timestamp {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    user-select: none;
    position: static;
}

.message .text-body {
    position: relative;
    padding-bottom: 0;
    min-width: unset;
    font-size: 1em;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

#chatDiv .typing-container {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 95% !important;
    margin: -5px auto 10px auto !important;
    background: linear-gradient(90deg, rgba(30, 30, 30, 0.95) 0%, rgba(45, 45, 45, 0.9) 100%) !important;
    color: #00eaff !important;
    padding: 8px 20px !important;
    border-radius: 20px !important;
    font-size: 0.95rem !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    z-index: 10 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(0, 234, 255, 0.2) !important;
    box-sizing: border-box;
}

.typing-dots {
    display: flex;
}

.typing-dots span {
    animation: typingBlink 1.4s infinite both;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0%   { opacity: 0.2; transform: translateY(0); }
    20%  { opacity: 1;   transform: translateY(-2px); }
    100% { opacity: 0.2; transform: translateY(0); }
}

body.layout-split #callArea {
    padding: 10px !important;
    gap: 10px !important;
    min-height: auto !important;
    margin: 10px auto !important;
    max-width: 100% !important;
}

body.layout-split .participant-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    width: 100%;
}

body.layout-split .participant-wrapper.sharing-active {
    flex-direction: row;
    background: rgba(0, 234, 255, 0.05);
    padding: 10px;
    border-radius: 15px;
    border: 1px solid rgba(0, 234, 255, 0.3);
    width: fit-content !important;
    max-width: 100%;
    margin: 0 auto;
    justify-content: center;
}

body.layout-split .sharing-active > .participant-video-box,
body.layout-split .sharing-active > .video-placeholder {
    width: 30% !important;
    max-width: 120px !important;
    height: auto !important;
    aspect-ratio: 1;
    min-height: auto !important;
    margin: 0 !important;
}

body.layout-split #screenShareArea,
body.layout-split #remoteScreenShareArea {
    width: 65% !important;
    max-width: 500px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    flex-shrink: 0;
    display: none;
    position: relative;
}

body.layout-split #localScreenVideo,
body.layout-split #remoteScreenVideo {
    width: 100% !important;
    border-radius: 12px !important;
}

body.layout-split #localScreenFsBtn,
body.layout-split #remoteScreenFsBtn {
    z-index: 50 !important;
}

body.layout-split #chatDiv.chat-active #deleteGroupButton,
body.layout-split #chatDiv.chat-active #leaveGroupButton {
    display: none !important;
}

body.layout-split #chatDiv.chat-active #chatHeader {
    position: absolute !important;
    top: 13x !important;
    left: 0 !important;
    right: 0 !important;
    padding-inline-start: 70px !important;
    padding-inline-end: 20px !important;
    margin: 0 !important;
    border: none !important;
    z-index: 20 !important;
    display: flex !important;
    justify-content: flex-start !important;
    pointer-events: none !important;
}
body.layout-split #chatDiv.chat-active #chatHeader button,
body.layout-split #chatDiv.chat-active #chatHeader .friend-dropdown {
    pointer-events: auto !important;
}

body.layout-split #chatDiv.chat-active #chatHeader h2 {
    background: #1a1a1a;
    border: 1px solid #00eaff;
    color: #00eaff;
    padding: 2px 14px;
    border-radius: 12px;
    font-size: 0.8em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    margin: 0;
    transform: translateY(0) !important;
    white-space: nowrap !important;
}

body.layout-split #chatDiv.chat-active #callArea {
    margin-top: 0 !important;
    padding-top: 20px !important;
    position: relative;
}

body.layout-split #chatDiv.chat-active #messages {
    flex-grow: 1 !important;
    height: auto !important;
    max-height: none !important;
    margin-top: 10px !important;
}
body.layout-split.is-in-call #callButton {
    display: none !important;
}

body.layout-split.no-active-chat #chatDiv {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 250px;
    padding: 12px 24px;
    border-radius: 12px;
    color: #fff;
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info    { background: rgba(0, 234, 255, 0.85); border: 1px solid #00eaff; color: #121212; }
.toast-success { background: rgba(0, 204, 102, 0.85); border: 1px solid #00cc66; }
.toast-error   { background: rgba(255, 77, 79, 0.85);  border: 1px solid #ff4d4f; }
.toast-warning { background: rgba(255, 170, 0, 0.85);  border: 1px solid #ffaa00; }

#chatDiv img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    margin: 5px 0;
}

.btn-hangup-circle {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 77, 79, 0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    animation: popIn 0.5s ease-out;
    margin: 0 10px;
    z-index: 1;
}

.btn-hangup-circle .icon {
    font-size: 20px;
    color: white;
    transform: rotate(135deg);
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.btn-hangup-circle:hover {
    transform: scale(1.1);
    background: rgba(255, 77, 79, 0.5);
    box-shadow: 0 15px 35px rgba(255, 77, 79, 0.4);
}

.btn-hangup-circle:hover .icon {
    transform: rotate(135deg) scale(1.2);
}

.btn-hangup-circle:active {
    transform: scale(0.9);
    background: rgba(255, 77, 79, 0.7);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.glass-shine {
    position: absolute;
    top: 5px;
    left: 15%;
    width: 70%;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
    border-radius: 50% / 100% 100% 0 0;
    pointer-events: none;
}

.participant-video-box video,
.participant-video-box .video-placeholder {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.bg-bubbles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-bubbles .bubble {
    position: absolute;
    bottom: -150px;
    background: radial-gradient(circle at 30% 30%, rgba(0, 234, 255, 0.15), rgba(0, 204, 136, 0.05));
    border: 1px solid rgba(0, 234, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: floatUp infinite ease-in;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-120vh) scale(1.5); opacity: 0; }
}

.bg-bubbles .bubble:nth-child(1) { left: 10%; width: 80px; height: 80px; animation-duration: 12s; }
.bg-bubbles .bubble:nth-child(2) { left: 25%; width: 50px; height: 50px; animation-duration: 18s; animation-delay: 2s; }
.bg-bubbles .bubble:nth-child(3) { left: 70%; width: 120px; height: 120px; animation-duration: 15s; animation-delay: 4s; }
.bg-bubbles .bubble:nth-child(4) { left: 85%; width: 60px; height: 60px; animation-duration: 20s; animation-delay: 0s; }
.bg-bubbles .bubble:nth-child(5) { left: 45%; width: 40px; height: 40px; animation-duration: 14s; animation-delay: 6s; }
.bg-bubbles .bubble:nth-child(6) { left: 60%; width: 90px; height: 90px; animation-duration: 17s; animation-delay: 8s; }

.auth-container {
    background: rgba(25, 25, 25, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 234, 255, 0.15);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,234,255,0.05);
    border-radius: 24px;
    padding: 35px 30px;
    transition: all 0.4s ease;
    z-index: 10;
}

.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-logo-icon {
    font-size: 3.5em;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(0,234,255,0.5));
    animation: bounceIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.auth-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    margin-bottom: 25px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,0.05);
}

.auth-toggle button {
    flex: 1;
    background: transparent;
    color: #888;
    box-shadow: none;
    margin: 0;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.auth-toggle button:hover {
    color: #ccc;
    transform: none;
}

.auth-toggle button.active {
    background: rgba(0, 234, 255, 0.15);
    color: #00eaff;
    box-shadow: 0 4px 10px rgba(0,234,255,0.1);
}
.register-only, .register-only-btn {
    display: none;
}

#loginForm.is-register .register-only {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

#loginForm.is-register .register-only-btn {
    display: inline-block;
    animation: fadeIn 0.4s ease forwards;
}

#loginForm.is-register #btn-do-login {
    display: none;
}

.auth-submit-btn {
    width: 100%;
    margin-top: 25px;
    padding: 16px;
    font-size: 1.15em;
    border-radius: 14px;
    letter-spacing: 0.5px;
}

.btn-login {
    background: linear-gradient(135deg, #0078ff, #00a8cc);
}

.btn-register {
    background: linear-gradient(135deg, #00eaff, #00cc88);
    color: #121212;
}

.custom-file-input {
    width: 100%;
    padding: 14px 15px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: 1px dashed rgba(0,234,255,0.3);
    border-radius: 12px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-file-input:hover {
    border-color: #00eaff;
    background: rgba(0,234,255,0.05);
}

.terms-container {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    color: #e0e0e0;
    font-size: 0.9em;
}

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

.terms-link {
    color: #00eaff;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
}

#emojiCategories::-webkit-scrollbar { display: none; }
.emoji-cat-btn { background: #2b2b2b; border: 1px solid #3a3a3a; padding: 8px; border-radius: 12px; cursor: pointer; font-size: 1.2em; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.emoji-cat-btn:hover { background: #3a3a3a; transform: translateY(-2px); }
.emoji-cat-btn.active { background: rgba(0, 234, 255, 0.2); border-color: #00eaff; box-shadow: 0 0 10px rgba(0, 234, 255, 0.2); }
.emoji-item { aspect-ratio: 1; display: flex; justify-content: center; align-items: center; font-size: 28px; cursor: pointer; transition: 0.15s; background: #252525; border-radius: 8px; border: 1px solid transparent; }
.emoji-item:hover { background: #333; transform: scale(1.15); border-color: #00eaff; z-index: 5; }

#emojiGrid::-webkit-scrollbar {
    width: 6px;
}
#emojiGrid::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 8px;
}
#emojiGrid::-webkit-scrollbar-thumb {
    background: rgba(0, 234, 255, 0.5);
    border-radius: 8px;
}
#emojiGrid::-webkit-scrollbar-thumb:hover {
    background: #00eaff;
}

#emojiCategoryTitle {
    color: #00eaff;
    font-size: 0.85em;
    font-weight: 700;
    padding: 8px 15px;
    margin: 0;
    text-align: start;
    background: linear-gradient(180deg, #1e1e1e 0%, #222 100%);
    border-bottom: 1px solid #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 10;
}

#emojiToggleBtn {
    background: #2b2b2b;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    filter: grayscale(100%) opacity(0.7);
}

#emojiToggleBtn:hover,
#emojiToggleBtn.active {
    background: #3a3a3a;
    border-color: #00eaff;
    filter: grayscale(0%) opacity(1);
    transform: translateY(-2px);
}

.animated-emoji {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    margin: 0 2px;
    position: relative;
}

.animated-emoji img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}

.birthday-selectors {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.birthday-selectors select {
    background: #2b2b2b;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    flex: 1;
    font-family: inherit;
    font-size: 0.9em;
}

.birthday-selectors select:focus {
    border-color: #00eaff;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(43, 43, 43, 0.5);
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #3a3a3a;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background-color: #00eaff;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.save-bday-btn {
    margin-top: 10px;
    background: #00eaff;
    color: #121212;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.save-bday-btn:active {
    transform: scale(0.98);
}

.settings-btn {
    background: #2b2b2b;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    font-size: 0.9em;
    transition: border-color 0.2s;
}

.settings-btn:hover {
    border-color: #00eaff;
}

.games-modal-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #9c27b0;
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    height: 65vh;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 15px 40px rgba(156, 39, 176, 0.3);
    animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.game-card {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(0, 234, 255, 0.3);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}
.game-card:hover {
    transform: translateY(-5px);
    background: rgba(0, 234, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 234, 255, 0.4);
}
.game-icon { font-size: 4em; }
.game-title { color: #fff; font-weight: bold; font-size: 1.2em; margin-top: 10px; }
.poker-table {
    background: radial-gradient(circle, #008844 0%, #005522 100%);
    border: 10px solid #5c3a21;
    border-radius: 100px;
    height: 200px;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}
.cards-container, .my-cards {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.playing-card {
    width: 50px;
    height: 75px;
    background: #fff;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    animation: slideInUp 0.3s ease-out;
}
.card-red { color: #ff4d4f; }
.card-black { color: #121212; }
.pot-display {
    background: rgba(0,0,0,0.6);
    color: #fd0;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: bold;
    margin-top: 15px;
}
.poker-players-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-bottom: auto;
}
.poker-controls {
    background: rgba(0,0,0,0.5);
    padding: 15px;
    border-radius: 15px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.action-buttons button {
    padding: 10px 15px;
    margin: 0 5px;
    font-weight: bold;
    border-radius: 8px;
}
.btn-fold { background: #ff4d4f; }
.btn-check { background: #00eaff; color: #121212; }
.btn-raise { background: #fd0; color: #121212; }

.participant-video-box.is-gaming {
    border: 4px solid #9c27b0 !important;
    border-color: #9c27b0 !important;
    box-shadow: 0 0 25px 8px rgba(156, 39, 176, 0.9) !important;
    outline: none !important;
    transition: all 0.3s ease;
}

.game-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(156, 39, 176, 0.85);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.game-indicator.active {
    opacity: 1;
    animation: bounceIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.poker-media-slot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto;
    border: 2px solid rgba(0, 234, 255, 0.4);
    background: #1a1a1a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.poker-media-slot video,
.poker-media-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poker-player.active-turn .poker-media-slot {
    border-color: #fd0;
    box-shadow: 0 0 15px #fd0;
    transform: scale(1.1);
}

.poker-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #2a2a2a;
    padding: 10px 15px;
    border-radius: 15px;
    min-width: 90px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.poker-player.active-turn {
    background: rgba(255, 221, 0, 0.1);
}

#burgerGameArea {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1a1a1a;
    border-radius: 15px;
    padding: 2%;
    box-shadow: 0 0 20px rgba(0, 234, 255, 0.2);
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.burger-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #00eaff;
}

#burgerCanvas {
    background: #2a2a2a;
    border: 3px solid #00eaff;
    border-radius: 10px;
    cursor: crosshair;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
    max-width: 100%;
    height: auto;
}

.exit-game-btn {
    background: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
}

.exit-game-btn:hover {
    background: #ff2427;
}

.poker-media-controls {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 8px 15px;
        background: rgba(255, 255, 255, 0.05);
        border: 2px solid #00d4ff;
        border-radius: 50px;
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), inset 0 0 10px rgba(0, 212, 255, 0.1);
        backdrop-filter: blur(5px);
        transition: all 0.3s ease;
        margin-right: 10px;
    }
    .poker-media-controls:hover {
        box-shadow: 0 0 25px rgba(0, 212, 255, 0.7);
        border-color: #55eaff;
    }
    .poker-media-controls .switch,
    .poker-media-controls .camera-toggle {
        min-width: 45px;
        min-height: 45px;
        flex-shrink: 0;
        border: none;
    }
    #poker-mic-checkbox { display: none; }
    #poker-mic-checkbox:checked + .switch { background-color: #ff4d4f; box-shadow: 0 0 10px #ff4d4f; }

@keyframes bubbleIn {
    0% {
    transform: scale(0);
    opacity: 0;
    }
    60% {
    transform: scale(1.2);
    }
    100% {
    transform: scale(1);
    opacity: 1;
    }
}

.game-avatars-container {
    position: absolute;
    top: -15px;
    right: -10px;
    display: flex;
    flex-direction: row-reverse;
    z-index: 10;
    pointer-events: none;
}

.game-menu-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid #1a1a2e;
    background-color: #121212;
    object-fit: cover;
    margin-left: -12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    position: relative;
    pointer-events: auto;
    animation: bubbleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    transition: transform 0.2s ease, z-index 0.2s, border-color 0.2s;
}

.game-menu-avatar:hover {
    transform: scale(1.2) translateY(-5px);
    z-index: 20 !important;
    border-color: #00eaff;
}

.raise-menu-popup {
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    transform: none;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #fd0;
    border-radius: 15px;
    padding: 15px;
    width: 240px;
    max-width: 95vw;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 15px rgba(255, 221, 0, 0.3);
    z-index: 100;
    animation: bounceIn 0.3s ease;
}
html[dir="ltr"] .raise-menu-popup,
[dir="ltr"] .raise-menu-popup {
    left: auto;
    right: 0;
}

.raise-menu-popup::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 25px;
    transform: none;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #fd0 transparent transparent transparent;
}
html[dir="ltr"] .raise-menu-popup::after,
[dir="ltr"] .raise-menu-popup::after {
    left: auto;
    right: 25px;
}

.raise-menu-header {
    color: #fff;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

#raiseAmountVal {
    color: #00eaff;
    font-size: 1.2em;
}

.custom-raise-slider {
    position: relative;
    width: 100%;
    height: 6px;
    background: #555;
    border-radius: 3px;
    margin: 10px 0 25px;
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

.custom-raise-fill {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: #fd0;
    border-radius: 3px;
    pointer-events: none;
    width: 0%;
}

.custom-raise-thumb {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    background: #fd0;
    border-radius: 50%;
    transform: translate(50%, -50%);
    pointer-events: auto;
    cursor: grab;
    box-shadow: 0 0 10px rgba(255, 221, 0, 0.7);
    right: 0%;
}

.custom-raise-thumb:active {
    cursor: grabbing;
}

.raise-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin-bottom: 12px;
}

.raise-presets button {
    flex: 1;
    min-width: 100%;
    padding: 8px;
    font-size: 0.85em;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.raise-presets button:hover {
    background: #555;
    border-color: #fd0;
}

.raise-presets .all-in-btn {
    background: #ff4d4f;
    border-color: #ff4d4f;
    font-weight: bold;
}

.raise-presets .all-in-btn:hover {
    background: #ff2427;
    box-shadow: 0 0 15px #ff4d4f;
}

.confirm-raise-btn {
    background: #fd0;
    color: #121212;
    flex: 1;
    min-width: 100%;
    font-weight: bold;
    font-size: 1.1em;
    padding: 10px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.1s ease;
    box-sizing: border-box;
}

.confirm-raise-btn:active {
    transform: scale(0.95);
}

input[type="range"] {
    padding: 0;
    margin: 0;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    accent-color: #00eaff;
    flex-grow: 1;
}

input[type="range"]:focus {
    box-shadow: none;
    border: none;
}
/* === Voice & Video Settings UI === */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}
.custom-select-trigger {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 234, 255, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.custom-select-trigger:hover {
    border-color: #00eaff;
    background: rgba(0, 234, 255, 0.05);
}
.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid #00eaff;
    border-radius: 12px;
    margin-top: 5px;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.custom-select-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}
.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(0, 234, 255, 0.5);
    border-radius: 10px;
}
.custom-select-option {
    padding: 12px 16px;
    color: #e0e0e0;
    cursor: pointer;
    transition: background 0.2s ease;
}
.custom-select-option:hover {
    background: rgba(0, 234, 255, 0.1);
    color: #00eaff;
}
.custom-select-option.selected {
    background: rgba(0, 234, 255, 0.2);
    color: #00eaff;
    font-weight: bold;
}
.mic-level-bar {
    display: flex;
    gap: 4px;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.mic-dot {
    flex: 1;
    height: 12px;
    background: #333;
    border-radius: 4px;
    transition: all 0.05s ease;
}

/* --- Chat Dropdown Items --- */
#chatDropdown div {
    white-space: nowrap;
}

/* --- Group Modals Clean Fix --- */
#groupMembersModal, #editGroupModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999; /* השכבה הכי גבוהה באפליקציה */
    display: none; /* נפתח דרך ה-JS */
    justify-content: center;
    align-items: center;
}

#groupMembersModal > .create-group-modal, 
#editGroupModal > .create-group-modal {
    margin: 0 auto;
    position: relative;
    z-index: 1000000;
    width: 90%;
    max-width: 400px;
}


/* --- Active Call Indicator --- */
.active-call-indicator {
    border: 2px solid #ff4d4f !important;
    box-shadow: 0 0 15px rgba(255, 77, 79, 0.4) !important;
    animation: activeCallPulse 2s infinite !important;
    z-index: 5 !important;
}

@keyframes activeCallPulse {
    0% { box-shadow: 0 0 5px rgba(255, 77, 79, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 77, 79, 0.7); }
    100% { box-shadow: 0 0 5px rgba(255, 77, 79, 0.2); }
}

.call-icon-badge {
    position: absolute;
    top: -10px;
    background: #ff4d4f;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10;
}

html[dir="rtl"] .call-icon-badge { right: -10px; }
html[dir="ltr"] .call-icon-badge { left: -10px; }

.splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #121212 0%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999; /* תמיד מעל הכל */
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* הקלאס שנוסיף דרך ה-JS כדי להעלים אותו */
.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    font-size: 5em;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(0, 234, 255, 0.6));
    animation: bounceIn 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.splash-title {
    color: #00eaff;
    font-size: 2.5em;
    margin: 0;
    text-shadow: 0 0 20px rgba(0, 234, 255, 0.5);
    font-weight: 700;
    letter-spacing: 1px;
}

.splash-loader {
    width: 40px;
    height: 40px;
    margin-top: 30px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #00eaff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* אנימציית Glow לדיבור */
.participant-video-box {
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

/* שאר המשתתפים - Glow תכלת */
.participant-video-box.is-speaking {
    box-shadow: 0 0 25px 8px rgba(0, 234, 255, 0.6), inset 0 0 15px rgba(0, 234, 255, 0.3) !important;
    border-color: #55eaff !important;
}

/* אתה - Glow צהוב */
.participant-video-box.local-user.is-speaking {
    box-shadow: 0 0 25px 8px rgba(255, 221, 0, 0.6), inset 0 0 15px rgba(255, 221, 0, 0.3) !important;
    border-color: #ffe600 !important;
}

/* 1. מחזירים את הגריד שיהיה יציב והחברים לא יתרחקו */
body.layout-split .group-video-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 180px)) !important;
    justify-content: center !important;
    gap: 49px !important; /* הקטנתי מעט את ה-gap כדי שיהיה יותר מקום בצדדים */
    padding: 1px !important;
    display: grid !important;
}

/* 2. המעטפת של השיתוף - תופסת 2 משבצות בגריד במקום שורה שלמה */
body.layout-split .participant-wrapper.sharing-active {
    grid-column: span 2 !important; /* הקסם כאן: תופס מקום של שני אנשים */
    width: 100% !important;
    min-width: 380px !important; /* מבטיח שיהיה מספיק רוחב לשיתוף + מצלמה */
    max-width: 550px !important; 
    flex-direction: row;
    display: flex !important;
    background: rgba(0, 234, 255, 0.05);
    padding: 8px !important;
    border-radius: 15px;
    border: 1px solid rgba(0, 234, 255, 0.3);
    align-items: center;
    gap: 10px !important;
    justify-self: center; /* שומר על זה במרכז */
}

/* 3. אזור השיתוף בתוך המעטפת */
body.layout-split #screenShareArea,
body.layout-split #remoteScreenShareArea {
    width: 70% !important; 
    max-width: 400px !important; 
    margin: 0 !important;
    border-radius: 10px !important;
    flex-shrink: 0;
}

/* 4. המצלמה שלך ליד השיתוף */
body.layout-split .sharing-active > .participant-video-box,
body.layout-split .sharing-active > .video-placeholder {
    width: 30% !important;
    max-width: 110px !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin: 0 !important;
}

/* יומן שיחות - הודעת מערכת מרכזית */
.call-system-log {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 12px 0;
    clear: both;
}

.call-system-log-inner {
    background: rgba(255, 255, 255, 0.05);
    color: #b0b0b0;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-style: italic;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: none; /* שלא יציק כשלוחצים */
}

/* === Custom Context Menu (Volume Control) === */
.custom-context-menu {
    display: none;
    position: fixed;
    z-index: 100000;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #00eaff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 234, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    min-width: 200px;
    direction: rtl;
    animation: bounceIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.context-menu-header {
    color: #fd0;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    text-align: center;
}

.context-menu-body label {
    color: #e0e0e0;
    font-size: 0.85em;
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.context-menu-body input[type="range"] {
    width: 100%;
    margin: 0;
    accent-color: #00eaff;
    cursor: pointer;
}

.context-menu-body input[type="range"]:focus {
    box-shadow: none;
    border: none;
}

/* מסגרת אדומה ואפקט כשהמשתמש מושתק מקומית */
.participant-video-box.is-locally-muted {
    border: 4px solid #ff4d4f !important;
    border-color: #ff4d4f !important;
    box-shadow: 0 0 25px 8px rgba(255, 77, 79, 0.6) !important;
    outline: none !important;
    transition: all 0.3s ease;
}


@keyframes chunkTravel {
    0% { left: 0; opacity: 0; transform: scale(0.5) translateY(0); }
    10% { opacity: 1; transform: scale(1) translateY(-3px); }
    90% { opacity: 1; transform: scale(1) translateY(3px); }
    100% { left: calc(100% - 15px); opacity: 0; transform: scale(0.5) translateY(0); }
}

.transfer-chunk {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #00eaff, #0078ff);
    box-shadow: 0 0 8px rgba(0, 234, 255, 0.8);
    top: 50%;
    margin-top: -6px;
    animation: chunkTravel 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}
