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

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

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

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

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

@keyframes friendItemSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(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;
    inset-inline-end: 14px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    margin-top: 5px;
}

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

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


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

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

/* ==========================================
   כיווץ מודאל יצירת קבוצה ותיקון כפתור ה-X והשכבות
============================================ */

#createGroupModal .folder-modal,
#create-group-modal .folder-modal {
    padding: 15px 22px !important;
    gap: 8px !important;
}

/* כיווץ עדין של הכותרת */
#createGroupModal h2, #create-group-modal h2,
#createGroupModal h3, #create-group-modal h3 {
    margin-top: 0px !important;
    margin-bottom: 8px !important;
    font-size: 1.45rem !important;
}

/* הידוק שדות הקלט והלייבלים */
#createGroupModal input[type="text"], #create-group-modal input[type="text"],
#createGroupModal select, #create-group-modal select {
    padding: 8px 12px !important;
    margin-bottom: 6px !important;
}

/* כיווץ רשימת החברים לבחירה */
#createGroupModal #createGroupFriendsList,
#createGroupModal .friends-list,
#createGroupModal div[id*="List"],
#create-group-modal div[id*="List"] {
    max-height: 130px !important;
    overflow-y: auto !important;
    padding: 4px !important;
    margin-bottom: 6px !important;
}

/* כיווץ השורות בתוך רשימת החברים */
#createGroupModal #createGroupFriendsList label,
#createGroupModal .friends-list label,
#createGroupModal div[id*="List"] label {
    padding: 4px 8px !important;
    margin-bottom: 2px !important;
}

/* כיווץ כפתורי ה"ביטול" ו"צור קבוצה" בתחתית - ללא כפתור ה-X */
#createGroupModal button:not(.create-group-close),
#create-group-modal button:not(.create-group-close) {
    padding: 8px 16px !important;
    margin-top: 4px !important;
}

/* הגנה וסידור מחדש של כפתור ה-X כדי שלא יתעוות לנקודה */
#createGroupModal .create-group-close,
#create-group-modal .create-group-close {
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* תיקון שכבות: גורם למודאל וגם לרקע שלו להיות תמיד בשכבה הכי עליונה מעל ההדר */
#createGroupModal,
#create-group-modal,
.folder-overlay,
.create-group-overlay {
    z-index: 99999 !important;
}

/* מעיף את הפס גלילה המכוער מהרקע של המודאל */
.create-group-overlay {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* מעיף את הפס גלילה בכרום, ספארי ואופרה */
.create-group-overlay::-webkit-scrollbar {
    display: none;
}

/* תיקון תצוגת אלמנט select בדארק מוד - מניעת טקסט לבן על רקע לבן */
.create-group-input option {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

/* אופציונלי: מבטיח שגם במצב פוקוס או בחירה האלמנט יישאר יציב */
.create-group-input:focus option {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

/* הגדרות למודל חברי קבוצה ועריכת קבוצה */
#groupMembersModal, #editGroupModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: none;
    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;
}

/* הגדרות למודל פרופיל משתמש */
#userProfileModal #profileModalName,
#userProfileModal #profileModalExtra > div:first-child {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

#userProfileModal #profileModalExtra > div:first-child span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
}

#userProfileModal {
    position: fixed;
    z-index: 99999 !important;
}

/* Modal לתיקייה הפתוחה */
.folder-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.folder-modal {
    background: rgba(25, 25, 25, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 234, 255, 0.3);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.folder-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.folder-modal-header h3 {
    margin: 0;
    color: #00eaff;
    flex-grow: 1;
    text-align: right;
    outline: none;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s;
}

.folder-modal-header h3:focus {
    background: rgba(0, 234, 255, 0.1);
}

/* העדכון של הרשימה עצמה */
.folder-friends-list {
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 234, 255, 0.3) transparent;
}

/* העלמת הסקרולבר המכוער ועיצוב תואם לשאר האפליקציה */
.folder-friends-list::-webkit-scrollbar {
    width: 6px;
}

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

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

.folder-friends-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 234, 255, 0.6);
}

/* מונע מהכפתור להמעך כשיש הרבה חברים */
#deleteFolderBtn {
    flex-shrink: 0;
}

/* מידות מותאמות למודל עריכת תיקייה */
.edit-folder-modal {
    max-width: 320px !important;
    text-align: center;
    padding: 25px !important;
}

/* הגדרות למודל תרגום אוטומטי */
#autoTranslateModal.active {
    align-items: center;
    padding-top: 0;
}
