/* CSS Custom Properties for Theming */
:root {
    --primary-color: #6600ee;
    --primary-hover: #d3c8ff;
    --danger-color: #000000;
    --danger-hover: #a9a9a9;
    --neutral-color: #6c757d;
    --neutral-hover: #adb5bd;
    --background-color: white;
    --text-color: black;
    --border-color: #e6e6e6;
    --input-background: #f5f5ff;
    --card-background: #ffffff;
    --hover-color: #f0eaff;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.12);
    --disabled-bg: #cccccc;
    --disabled-text: #666666;
    --disabled-border: #aaaaaa;
    --disabled-opacity: 0.6;
    --paused-opacity: 0.5;
}

body.dark {
    --background-color: #1e1e1e;
    --text-color: #e0e0e0;
    --border-color: #444;
    --input-background: #2a2a2a;
    --card-background: #2a2a2a;
    --hover-color: #3a3a3a;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.3);
    --disabled-bg: #555555;
    --disabled-text: #999999;
    --disabled-border: #444444;
}

.hidden {
    display: none !important;
}

/* Shared body styling */
* {
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    background: white;
    overflow-x: hidden;
    font-family: 'Global Sans Serif', sans-serif;
    height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--input-background);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    z-index: 100;
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.rfiler-logo {
    width: 15vw;
    max-width: 187px;
    height: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    margin-left: auto; /* Right-align nav links */
    gap: 1rem; /* Spacing between items */
    height: 60px; /* Fixed navbar height */
}

.user-profile {
    position: relative; /* For dropdown positioning */
    display: flex;
    align-items: center;
    cursor: pointer; /* Indicate clickability */
    padding: 0 8px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 8px;
    line-height: 1.3;
}

.user-name {
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #6600ee;
    margin-right: 8px;
}

.user-email {
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #6600ee;
    opacity: 0.7;
}


.user-icon {
    font-size: 20px;
    color: #6600ee;
}

.user-menu {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    min-width: 150px;
    padding: 0.5rem 0;
    overflow: hidden;
}

    .user-menu.active {
        display: block;
    }

.nav-links a, .settings-link {
    padding: 0 8px;
    text-decoration: none;
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: black;
    line-height: 60px;
    display: inline-block;
    transition: color 0.2s ease;
}

header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-links a:hover, .settings-link:hover {
    color: var(--primary-color);
}

.nav-links a.active {
    color: var(--primary-color);
    font-weight: 500;
}

.user-menu a, .settings-link {
    display: block;
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 14px;
    color: black;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-menu a:hover, .settings-link:hover {
    background: var(--hover-color);
    color: var(--primary-color);
}

/* Loading spinner styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(255, 255, 255);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    border: 8px solid #6600ee;
    border-top: 8px solid #d3c8ff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none;
}

/* Footer buttons */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border-color);
    padding: 0.4rem 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    z-index: 99;
    transition: background 0.3s, border-color 0.3s;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.04);
}

body.dark footer {
    background: var(--background-color);
    border-top-color: var(--border-color);
}

.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

    .action-buttons a {
        text-decoration: none;
    }

.help-icon {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-us-icon {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 0.35rem 0.7rem !important;
    height: 28px !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    box-shadow: var(--shadow-light) !important;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
    white-space: nowrap !important;
    font-family: 'Global Sans Serif', sans-serif !important;
    line-height: 1 !important;
}

.explain-this-icon {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 0.35rem 0.7rem !important;
    height: 28px !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    box-shadow: var(--shadow-light) !important;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
    white-space: nowrap !important;
    font-family: 'Global Sans Serif', sans-serif !important;
    line-height: 1 !important;
}

.contact-us-icon i,
.explain-this-icon i {
    font-size: 0.7rem !important;
    display: inline-flex !important;
    align-items: center !important;
}

.contact-us-icon span,
.explain-this-icon span {
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    display: inline-block !important;
}

    .help-icon:hover {
        background: var(--primary-hover);
        color: black;
        transform: scale(1.1);
        box-shadow: var(--shadow-hover);
    }

    .contact-us-icon:hover,
    .explain-this-icon:hover {
        background: var(--primary-hover) !important;
        color: black !important;
        transform: scale(1.05) !important;
        box-shadow: var(--shadow-hover) !important;
    }

body.dark .help-icon {
    background: #a78bfa;
}

body.dark .contact-us-icon,
body.dark .explain-this-icon {
    background: #a78bfa !important;
}

    body.dark .help-icon:hover {
        background: #d3c8ff;
    }

    body.dark .contact-us-icon:hover,
    body.dark .explain-this-icon:hover {
        background: #d3c8ff !important;
    }

/* Essential Page Elements */
main {
    padding: 100px 0px 45px 20px;
    min-height: calc(100vh - 45px);
    background: var(--background-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0 auto;
    min-height: calc(100vh - 82px);
    padding-bottom: 80px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6600ee #f3effc;
}

.encrypt-page {
    display: flex;
    flex-direction: row;
    min-height: calc(100vh - 80px);
    padding-top: 80px;
    gap: 2rem;
    margin: 0;
}

.groups-page, .contacts-page, .settings-page, .admin-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: center;
    max-height: calc(100vh - 80px);
    padding-bottom: 80px;
    gap: 1.5rem;
}

.groups-page, .contacts-page, .settings-page {
    width: auto;
}

.admin-page {
    width: 100%;
}

.encrypt-section, .decrypt-section {
    background: white;
    border: none;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    
}

.panel-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    border: 1px var(--primary-color) solid;
    margin-bottom: 2rem;
    position: relative;
}

h1 {
    font-family: 'Global Sans Serif', sans-serif;
    font-weight: 500;
    font-size: 3.5rem;
    color: black;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    text-align: center;
}

h2 {
    display: block;
    font-size: 1.5em;
    margin-block-start: 0.83em;
    margin-block-end: 0.2em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
    unicode-bidi: isolate;
    margin-right: 1.2rem;
}

h3 {
    font-family: 'Global Sans Serif', sans-serif;
    font-weight: 550;
    color: black;
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
    text-wrap-mode: nowrap;
}

h4 {
    font-family: 'Global Sans Serif', sans-serif;
    font-weight: 500;
    color: black;
    font-size: 1rem;
    margin: 0 0 0rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-wrap-mode: nowrap;
}

h5 {
    font-family: 'Global Sans Serif', sans-serif;
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.95rem;
    margin: 0 0 0rem;
    text-wrap-mode: nowrap;
}


p {
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 0.9rem;
    color: black;
    margin: 0;
}

.status {
    color: var(--primary-color);
    font-weight: 500;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

label {
    display: flex;
    align-items: center;
}

.tooltip-icon {
    font-size: 0.9rem;
    cursor: pointer;
    color: #666;
}

    .tooltip-icon:hover::after {
        content: "Use ✔ in the sidebar or drag here to add to this list, ✖ to add to the block list";
        position: absolute;
        top: -2rem;
        left: 50%;
        transform: translateX(-50%);
        background: #333;
        color: white;
        padding: 0.3rem 0.6rem;
        border-radius: 4px;
        font-size: 0.8rem;
        white-space: nowrap;
        z-index: 10;
    }

.tooltip-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.tooltip {
    display: inline-block;
    font-size: 18px;
    color: #6600ee;
    margin-left: 10px;
    cursor: pointer;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 0.9rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: solid transparent;
    border-width: 6px;
    border-top-color: #333;
}

/* Search Bar */
.search-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-color);
    font-size: 1rem;
}

.search-bar {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 0.95rem;
    background: #ffffff;
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .search-bar::placeholder {
        color: var(--neutral-color);
    }

    .search-bar:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(102, 0, 238, 0.1);
    }

/* Buttons */
.major-btn {
    max-width: 350px;
    padding: 1rem 2rem;
    font-size: 1.4rem;
    text-decoration: none;
    border-radius: 8px;
}

.minor-btn {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    max-height: 30px;
    text-decoration: none;
    border-radius: 6px;
}

.action-btn {
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
    max-height: 30px;
    text-decoration: none;
    border-radius: 4px;
}

.major-btn, .minor-btn, .action-btn {
    border: none;
    font-family: 'Global Sans Serif', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-wrap-mode: nowrap;
}

    .major-btn:hover, .minor-btn:hover, .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-light);
    }

.primary {
    background-color: var(--primary-hover);
    color: black;
    border: none;
}

    .primary:hover {
        background-color: var(--primary-color);
        color: white;
    }

.danger-btn {
    background-color: var(--danger-hover);
    color: black;
}

    .danger-btn:hover {
        background-color: var(--danger-color);
        color: white;
    }

.cancel-btn {
    background-color: var(--neutral-hover);
    color: black;
}

    .cancel-btn:hover {
        background-color: var(--neutral-color);
        color: white;
    }

.major-btn:disabled, .minor-btn:disabled, .action-btn:disabled {
    opacity: var(--paused-opacity);
    cursor: not-allowed;
    background: var(--border-color);
    color: var(--neutral-color);
    box-shadow: none;
    transform: none;
}

.major-btn.loading, .minor-btn.loading, action-btn.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: not-allowed;
}

    .major-btn.loading:hover, .minor-btn.loading:hover, action-btn.loading:hover {
        background-color: #ccc;
        color: #666;
    }

/* Button Containers */
.major-btns {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.minor-btns {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.form-btns {
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.right-align {
    justify-self: flex-end;
    margin-top: 1rem;
}

/* Form Group */
.popup-form, .settings-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    width: 35rem;
    gap: 1rem;
}

.form-group {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

    .form-group:not(.support-message) {
        flex-direction: row;
        justify-content: flex-end;
        gap: 1rem;
    }

.support-message {
    flex-direction: column;
    gap: 0rem;
    align-items: flex-start;
}

.form-group label:not(.screenshot-input label), .group-name-section label, .add-new-members-section h3, .add-contact-section h3, .group-status-section h3, .invite-user-section h3 {
    color: var(--primary-color);
    text-wrap-mode: nowrap;
    font-weight: 550;
    min-width: 7rem;
    max-width: 9rem;
    width: 100%;
    font-size: 0.9rem;
}

.screenshot-input label {
    color: var(--primary-color);
    text-wrap-mode: nowrap;
    font-weight: 550;
    font-size: 0.9rem;
}

.current-members-section h3, .add-members-section h3 {
    color: var(--primary-color);
    text-wrap-mode: nowrap;
    font-weight: 550;
    font-size: 1.2rem;
    margin: 0;
}

.form-group input, .form-group select, .form-group textarea, .group-name-section input, .email-input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 0.9rem;
    background: var(--input-background);
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

    .input-wrapper input {
        flex: 1;
    }

.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .group-name-section input:focus, .email-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 0, 238, 0.2);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group .minor-btn {
    align-self: flex-end;
}

/* Drag and Drop Area */
.drag-drop-area {
    background: white;
    border: 2px dashed #6600ee;
    border-radius: 8px;
    padding: 1.5rem;
    width: 100%;
    max-width: 700px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.decrypt-section .drag-drop-area {
    margin-bottom: 1rem;
}

.drag-drop-area i.fas.fa-cloud-download-alt {
    font-size: 2.5rem;
    color: #6600ee;
    margin-bottom: 1rem;
}

.drag-drop-area i.fas.fa-cloud-upload-alt {
    font-size: 2.5rem;
    color: #6600ee;
    margin-bottom: 0.5rem;
}

/* Sidebar */
.sidebar {
    width: 450px;
    padding-right: 1.5rem;
    background: white;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: #6600ee #f3effc;
}

    .sidebar::-webkit-scrollbar {
        width: 8px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: #f3effc;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: #6600ee;
        border-radius: 4px;
    }

    .sidebar ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

.encrypt-page .sidebar ul li, .employee-item {
    padding: 0.3rem 0.75rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 0.9rem;
    color: black;
    line-height: 1.5;
    min-height: 0;
    text-align: left;
    justify-content: space-between;
    gap: 1rem;
}

.sidebar ul li:hover {
    background: #f3effc;
}

.action-icons {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.add-icon, .block-icon {
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem;
}

.add-icon {
    color: #6600ee;
}

    .add-icon:hover {
        color: #d3c8ff;
    }

.block-icon {
    color: #000000;
}

    .block-icon:hover {
        color: #a9a9a9;
    }

.access-emails {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6600ee #f3effc;
}

    .access-emails::-webkit-scrollbar {
        width: 8px;
    }

    .access-emails::-webkit-scrollbar-track {
        background: #f3effc;
    }

    .access-emails::-webkit-scrollbar-thumb {
        background: #6600ee;
        border-radius: 4px;
    }

    .access-emails li {
        padding: 0.5rem;
        font-family: 'Global Sans Serif', sans-serif;
        font-size: 1rem;
        color: black;
        text-align: left;
    }

        .access-emails li:hover {
            background: #e0e0e0;
        }


/* File Info */
.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f3effc;
    border-radius: 8px;
    width: 100%;
    max-width: 1400px;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-name {
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 1rem;
    color: black;
    flex-grow: 1;
    text-align: left;
}

/* Access and Block Lists*/
.access-block-lists {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin: 1rem 0;
    width: 100%;
    max-width: 600px;
}

.access-list, .block-list {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chip-list.access, .chip-list.block {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 150px;
    overflow-y: auto;
    border: 2px solid #6600ee;
    border-radius: 4px;
    scrollbar-width: thin;
    scrollbar-color: #6600ee #f3effc;
}

    .chip-list.access::-webkit-scrollbar, .chip-list.block::-webkit-scrollbar {
        width: 8px;
    }

    .chip-list.access::-webkit-scrollbar-track, .chip-list.block::-webkit-scrollbar-track {
        background: #f3effc;
    }

    .chip-list.access::-webkit-scrollbar-thumb, .chip-list.block::-webkit-scrollbar-thumb {
        background: #6600ee;
        border-radius: 4px;
    }

    .chip-list.access li, .chip-list.block li {
        padding: 0.5rem 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-family: 'Global Sans Serif', sans-serif;
        font-size: 0.9rem;
        color: black;
        gap: 1rem;
        text-align: left;
    }

        .chip-list.access li:hover, .chip-list.block li:hover {
            background: #f3effc;
        }

.remove-icon {
    cursor: pointer;
    font-size: 1rem;
    color: #6600ee;
}

    .remove-icon:hover {
        color: #6600ee;
    }

/* Add Contact Form */
.add-person-section {
    display: flex;
    flex-direction: row;
    padding: 0.5rem;
    border-radius: 8px;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.contact-input-group {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
}

.contact-email-input, .member-email-input {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 0.9rem;
    background: var(--input-background);
    color: var(--text-color);
    width: -webkit-fill-available;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .contact-email-input:focus, .member-email-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 4px rgba(102, 0, 238, 0.3);
    }

    .contact-email-input::placeholder, .member-email-input::placeholder {
        color: var(--neutral-color);
    }

/* Group, Contacts, and Settings Pages*/
.groups-section, .contacts-section, .settings-section {
    padding: 1rem;
    max-width: 98vw;
    border-radius: 12px;
    transition: box-shadow 0.3s ease;
}

.groups-container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    width: 100%;
    justify-content: center;
}

.group-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-light);
    width: 50%;
    min-width: 390px;
}

.org-group-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-light);
    width: 100%;
    min-width: 750px;
}

.contacts-panel {
    background: var(--card-background);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 1rem;
    width: 650px;
}

.group-list, .owned-list, .other-list, .contact-list, .employee-list-container {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
    text-align: left;
    list-style: none;
    max-height: 45vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--card-background);
    margin: 0;
}

.group-item, .contacts-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0.3rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 400;
    transition: background 0.2s ease;
}

    .group-item:hover, .contacts-list li:hover {
        background: var(--hover-color);
    }

    .group-item span, .contacts-list li span {
        display: flex;
        flex-direction: row;
        font-family: 'Global Sans Serif', sans-serif;
        font-size: 0.9rem;
        max-width: 70%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        align-items: center;
        gap: 0.5rem;
    }

.other-list .group-name {
    flex: 1;
    min-width: 0;           /* Critical for flex ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    color: var(--text-color);
}

.other-list .group-item > span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;           /* Ensure the span allows shrinking */
}

.other-list .member-status {
    flex-shrink: 0;         /* Status badge doesn't shrink */
    margin-right: 0.5rem;
}

.group-name {
    text-overflow: ellipses;
}

/* Org/MSP Admin Dashboards */
.account-details, .msp-details {
    display: grid;
    gap: 0.75rem;
}

    .account-details p, .msp-details p {
        margin: 0;
        font-size: 0.95rem;
        color: var(--text-color);
    }

    .account-details strong, msp-details strong {
        font-weight: 550;
        color: var(--primary-color);
    }

.admin-content, .msp-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.admin-section {
    padding: 1rem;
    width: 100%;
    max-width: 1280px;
    border-radius: 12px;
}

.panel {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px var(--primary-color) solid;
    box-shadow: var(--shadow-light);
    transition: box-shadow 0.3s ease;
}

    .panel:hover {
        box-shadow: var(--shadow-hover);
    }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.org-list-toolbar {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

    .org-list-toolbar .search-wrapper {
        flex: 1;
        min-width: 0;
    }

.org-list-sort-btn {
    flex-shrink: 0;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

#orgList {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6600ee #f3effc;
}

.org-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
}

.org-name {
    font-weight: 600;
}

.org-domain, .org-admins {
    color: var(--neutral-color);
    font-size: 0.95rem;
}

/* File Viewer Popup */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.modal-file-content {
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 1rem;
    color: black;
    text-align: center;
    min-height: 250px;
    max-height: 600px;
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #6600ee #f3effc;
}

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

    .modal-file-content::-webkit-scrollbar-track {
        background: #f3effc;
    }

    .modal-file-content::-webkit-scrollbar-thumb {
        background: #6600ee;
        border-radius: 4px;
    }

    .modal-file-content p {
        margin: 0 0 1rem;
    }

    .modal-file-content h4 {
        font-family: 'Global Sans Serif', sans-serif;
        font-weight: 500;
        color: black;
        font-size: 1rem;
        margin: 0 0 0.5rem;
    }

    /* Explain popup styling - matching orgsignup style */
    .explain-popup-content {
        max-width: 600px;
        padding: 2rem;
    }

    .explain-content {
        font-family: 'Global Sans Serif', sans-serif;
        color: var(--text-color, black);
        line-height: 1.6;
    }

    .explain-content p {
        margin: 0 0 1rem 0;
        font-size: 1rem;
    }

    .explain-step {
        margin: 1.5rem 0;
        padding: 1rem;
        background: var(--input-background, #f5f5ff);
        border-radius: 8px;
        border-left: 4px solid var(--primary-color, #6600ee);
    }

    .explain-step h3 {
        font-family: 'Global Sans Serif', sans-serif;
        font-weight: 600;
        color: var(--primary-color, #6600ee);
        font-size: 1.1rem;
        margin: 0 0 0.5rem 0;
    }

    .explain-step h4 {
        font-family: 'Global Sans Serif', sans-serif;
        font-weight: 600;
        color: var(--primary-color, #6600ee);
        font-size: 1.1rem;
        margin: 0 0 0.5rem 0;
    }

    .explain-step p {
        font-family: 'Global Sans Serif', sans-serif;
        font-size: 0.95rem;
        color: var(--text-color, black);
        margin: 0.5rem 0;
    }

    .explain-step strong {
        color: var(--primary-color, #6600ee);
        font-weight: 600;
    }

    .explain-tip {
        margin: 1.5rem 0 0 0;
        padding: 1rem;
        background: rgba(102, 0, 238, 0.1);
        border-radius: 8px;
        border-left: 4px solid var(--primary-color, #6600ee);
    }

    .explain-tip p {
        font-family: 'Global Sans Serif', sans-serif;
        font-size: 0.95rem;
        color: var(--text-color, black);
        margin: 0;
    }

    .explain-tip strong {
        color: var(--primary-color, #6600ee);
        font-weight: 600;
    }

    body.dark .explain-step {
        background: var(--hover-color, #3a3a3a);
    }

    body.dark .explain-tip {
        background: rgba(167, 139, 250, 0.2);
    }

    body.dark .explain-content {
        color: var(--text-color, #e0e0e0);
    }

    body.dark .explain-step p,
    body.dark .explain-tip p {
        color: var(--text-color, #e0e0e0);
    }

    .modal-file-content .file-list-item {
        display: flex;
        align-items: center;
        padding: 0.5rem;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        transition: background 0.2s;
    }

        .modal-file-content .file-list-item:hover {
            background: #f0f0f0;
        }

    .modal-file-content .file-icon {
        margin-right: 0.75rem;
        font-size: 1.2em;
    }

    .modal-file-content .file-info {
        flex: 1;
        min-width: 0;
    }

    .modal-file-content .file-name {
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .modal-file-content .file-size {
        font-size: 0.85rem;
        color: #666;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .modal-file-content .zip-file-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .modal-file-content .zip-file-item {
        padding: 8px 0;
        display: flex;
        align-items: center;
        border-bottom: 1px solid var(--border-color);
        transition: background 0.2s ease;
    }

        .modal-file-content .zip-file-item:hover {
            background: var(--hover-color);
        }

    .modal-file-content .zip-file-name {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--text-color);
        font-size: 0.9rem;
        text-align: left;
        margin-left: 1rem;
    }

.zip-file-list {
    list-style: none;
    padding-left: 20px;
    margin: 0;
}

.zip-folder-item details {
    margin-bottom: 10px;
}

.zip-folder-item summary {
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .zip-folder-item summary:hover {
        color: var(--primary-color);
    }

.zip-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.zip-file-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Data Entry Popups */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

    .popup[style*="display: flex"] {
        display: flex;
    }

.popup-content {
    background: var(--card-background);
    padding: 2rem 2rem 2rem 2rem;
    border-radius: 12px;
    min-width: 30rem;
    max-width: 55rem;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    animation: slideIn 0.3s ease-in-out;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--card-background);
    box-sizing: border-box;
}

.popup-content h2 {
    margin: 0 0 2rem 0;
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 600;
    padding-top: 0.5rem;
}

/* Settings Popup Styling */
.settings-status-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(102, 0, 238, 0.05) 0%, rgba(102, 0, 238, 0.02) 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

.status-info h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-info .current-status {
    font-weight: 600;
    font-size: 0.95rem;
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.status-actions .status-action-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.status-actions .status-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 0, 238, 0.2);
}

.settings-role-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(102, 0, 238, 0.05) 0%, rgba(102, 0, 238, 0.02) 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.role-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

.role-info h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.role-info .user-role {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    width: 100%;
    box-sizing: border-box;
}

/* Account Status Banner */
.account-status-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #f44336;
    color: white;
    padding: 1rem 2rem;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
    gap: 1rem;
}

.account-status-banner button {
    background-color: white;
    color: #f44336;
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.account-status-banner button:hover {
    background-color: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.account-status-banner button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.account-status-banner i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.settings-form .form-group {
    margin: 0;
    align-items: center;
    flex-direction: row;
    gap: 1rem;
}

.settings-form .form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 140px;
    max-width: 140px;
    width: 140px;
    flex-shrink: 0;
}

.settings-form .form-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.settings-form .form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 0, 238, 0.1);
    outline: none;
}

.settings-form .form-group input[readonly] {
    background: var(--hover-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.settings-form .form-group:last-of-type {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
}

.settings-form .form-group:last-of-type .minor-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    min-width: 140px;
    transition: all 0.2s ease;
}

.settings-form .form-group:last-of-type .minor-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 0, 238, 0.3);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1100;
    background: white;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #333;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

    .close-btn:hover {
        color: var(--primary-color);
        transform: scale(1.1);
    }

    .close-btn:not(.employee-value) {
        position: absolute;
        top: 12px;
        right: 12px;
    }

.primary-popup .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px;
    line-height: 1;
}

.scroll-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1100;
    background: white;
}

/* Group Popup */
.group-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.group-popup[style*="display: flex"] {
    display: flex;
}

/* Group Edit Popup */
.group-popup .popup-content {
    width: 100%;
}

.contact-us-popup .popup-content {
    max-width: 600px;
}

.current-members-section, .add-members-section, .add-new-members-section {
    border-radius: 8px;
    width: 50%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--primary-color);
    transition: box-shadow 0.2s ease;
}

    .current-members-section:hover, .add-members-section:hover, .add-new-members-section:hover {
        box-shadow: var(--shadow-hover);
    }

.group-name-section {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.group-name-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.group-status-section {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

.group-actions {
    display: flex;
    gap: 0.75rem;
    height: 2.3rem;
}

.current-members-list, .members-list {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    width: 100%;
    text-align: left;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--card-background);
    margin-top: 0.3rem;
}

    .current-members-list li, .members-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0.75rem;
        font-family: 'Global Sans Serif', sans-serif;
        font-size: 0.75rem;
        color: var(--text-color);
        transition: background 0.2s ease;
    }

        .current-members-list li:hover, .members-list li:hover {
            background: var(--hover-color);
        }

    .current-members-list .member-info {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .current-members-list .member-actions {
        display: flex;
        gap: 0.5rem;
    }

.add-members-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.add-new-members-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.disabled-section {
    opacity: var(--paused-opacity);
    pointer-events: none;
    background: var(--card-background);
}

.paused-message {
    color: #d9534f;
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: center;
}

.group-name-section label::before {
    content: '\f15c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--primary-color);
    font-size: 1rem;
    margin-right: 0.5rem;
}

.divider {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
    justify-content: space-between
}

/* Contact Us Popup */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.paste-area {
    width: 100%;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--input-background);
    text-align: center;
    cursor: text;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

    .paste-area:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(102, 0, 238, 0.1);
    }

    .paste-area.disabled {
        background: var(--neutral-color);
        cursor: not-allowed;
    }

.paste-instruction {
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 0.95rem;
    color: var(--neutral-color);
    margin: 0;
}

.pasted-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.pasted-image {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    display: none;
    object-fit: contain;
}

.save-btn.loading {
    background-color: var(--neutral-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

    .save-btn.loading i.fa-paper-plane,
    .save-btn.loading span {
        visibility: hidden;
    }

    .save-btn.loading::before {
        content: "\f110";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: 1rem;
        color: white;
        animation: spin 1s linear infinite;
        position: absolute;
        visibility: visible;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.contact-us-popup .popup-content .message-text {
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.contact-us-popup .form-group select option:hover {
    background-color: var(--primary-color);
}

.role-actions {
    width: -webkit-fill-available;
}

/* Invite Popup */
.invite-user-popup {
    z-index: 1100;
}

.confirm-popup {
    z-index: 1200;
}

.invite-user-popup .input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.invite-user-popup .input-label {
    color: var(--primary-color);
    font-family: 'Global Sans Serif', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 80px;
}

.invite-user-popup .popup-content {
    max-width: 550px;
}

.invite-user-popup .invite-user-section, .settings-panel {
    background: rgba(102, 0, 238, 0.05);
    border-radius: 8px;
    padding: 1rem;
    width: 100%;
    min-width: 500px;
}

.invite-user-popup .new-member-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.invite-user-popup input {
    flex-grow: 1;
}

.invite-user-popup .popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
}

.send-invites-popup .popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
}

/* Toggle styles for send invites popup */
.send-invites-popup .email-toggle-section {
    margin-bottom: 0.5rem;
}

.send-invites-popup .toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.send-invites-popup .toggle-checkbox {
    display: none;
}

.send-invites-popup .toggle-slider {
    width: 50px;
    height: 26px;
    background: var(--border-color);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s ease;
}

.send-invites-popup .toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.send-invites-popup .toggle-checkbox:checked + .toggle-slider {
    background: var(--primary-color);
}

.send-invites-popup .toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.send-invites-popup .toggle-text {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Email form styles for send invites popup */
.send-invites-popup .email-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

.send-invites-popup .email-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.send-invites-popup .email-form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.send-invites-popup .email-form-label i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.send-invites-popup .email-form-input,
.send-invites-popup .email-form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--input-background);
    color: var(--text-color);
}

.send-invites-popup .email-form-input:focus,
.send-invites-popup .email-form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 0, 238, 0.1);
}

.send-invites-popup .email-form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Toggle styles for invite popup */
.invite-user-popup .email-toggle-section {
    margin-bottom: 0.5rem;
}

.invite-user-popup .toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.invite-user-popup .toggle-checkbox {
    display: none;
}

.invite-user-popup .toggle-slider {
    width: 50px;
    height: 26px;
    background: var(--border-color);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s ease;
}

.invite-user-popup .toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.invite-user-popup .toggle-checkbox:checked + .toggle-slider {
    background: var(--primary-color);
}

.invite-user-popup .toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.invite-user-popup .toggle-text {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Email form styles for invite popup */
.invite-user-popup .email-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

.invite-user-popup .email-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.invite-user-popup .email-form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.invite-user-popup .email-form-label i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.invite-user-popup .email-form-input,
.invite-user-popup .email-form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--input-background);
    color: var(--text-color);
}

.invite-user-popup .email-form-input:focus,
.invite-user-popup .email-form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 0, 238, 0.1);
}

.invite-user-popup .email-form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Same styles for add-contact-popup */
.add-contact-popup .email-toggle-section {
    margin-bottom: 0.5rem;
}

.add-contact-popup .toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.add-contact-popup .toggle-checkbox {
    display: none;
}

.add-contact-popup .toggle-slider {
    width: 50px;
    height: 26px;
    background: var(--border-color);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s ease;
}

.add-contact-popup .toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.add-contact-popup .toggle-checkbox:checked + .toggle-slider {
    background: var(--primary-color);
}

.add-contact-popup .toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.add-contact-popup .toggle-text {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

.add-contact-popup .email-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

.add-contact-popup .email-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.add-contact-popup .email-form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.add-contact-popup .email-form-label i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.add-contact-popup .email-form-input,
.add-contact-popup .email-form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--input-background);
    color: var(--text-color);
}

.add-contact-popup .email-form-input:focus,
.add-contact-popup .email-form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 0, 238, 0.1);
}

.add-contact-popup .email-form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}


.group-dropdown summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    transition: background 0.2s;
    gap: 0.5rem;
}

    .group-dropdown summary:hover {
        background: var(--hover-color);
    }

.dropdown-icon {
    transition: transform 0.3s;
}

.group-dropdown[open] .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-content {
    padding: 0.5rem;
    background: var(--input-background);
    border-top: 1px solid var(--border-color);
}

.member-list {
    list-style: none;
    padding: 0;
    max-height: 150px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

    .member-list li {
        padding: 0.3rem 0;
        font-size: 0.85rem;
    }

/* === PAUSED MEMBER STYLING === */
.paused-member,
.paused-member span {
    color: var(--neutral-color) !important;
    opacity: 0.7;
    font-style: italic;
}

.paused-icon {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-left: 0.4rem;
}

.group-summary.paused {
    color: var(--neutral-color);
    opacity: 0.7;
}

.action-icons.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.member-list.loading {
    color: var(--neutral-color);
    font-style: italic;
}

/* Tooltip on hover */
li:hover .paused-icon {
    position: relative;
}

    li:hover .paused-icon::after {
        content: attr(title);
        position: absolute;
        top: -28px;
        left: 50%;
        transform: translateX(-50%);
        background: #333;
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.75rem;
        white-space: nowrap;
        z-index: 100;
        pointer-events: none;
    }





/* -------------------------------------------------------------
   4. ORG‑SIGNUP PAGE – SCOPED STYLES (only inside .orgsignup-page)
   ------------------------------------------------------------- */
.orgsignup-page, .signup-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 100px 1rem 2rem;
    gap: 1.5rem;
    width: 100%;
    background: linear-gradient(to bottom, var(--background-color), var(--input-background));
}

.sign-in-link {
    position: absolute;
    font-family: 'Global Sans Serif', sans-serif;
    font-weight: 500;
    color: black;
    font-size: 1.2rem;
    text-decoration: none;
    right: 2rem;
    top: 2rem;
}

body.dark .sign-in-link {
    color: #e0e0e0;
}

.sign-in-link:hover {
    color: #6600ee;
}

body.dark .sign-in-link:hover {
    color: #a78bfa;
}


/* ---- Card Section ---- */
.orgsignup-page .orgsignup-section, .signup-page .signup-section {
    background: var(--card-background);
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6600ee #f3effc;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    transition: box-shadow 0.3s ease;
    text-align: center;
}

.orgsignup-page .orgsignup-section:hover, .signup-page .signup-section:hover {
    box-shadow: var(--shadow-hover);
}

.orgsignup-page .form-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
}

.orgsignup-page h2, .signup-page h2 {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

/* ---- Form ---- */
.orgsignup-page .orgsignup-form, .signup-page .signup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.orgsignup-page .form-group, .signup-page .form-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.orgsignup-page .form-group label, .signup-page .form-group label {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.orgsignup-page .form-group input[type="text"],
.orgsignup-page .form-group input[type="email"],
.signup-page .form-group input[type="text"],
.signup-page .form-group input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--input-background);
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.orgsignup-page .form-group input:focus, .signup-page .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 0, 238, 0.1);
}

.orgsignup-page .form-group input::placeholder, .signup-page .form-group input::placeholder {
    color: var(--neutral-color);
}

.orgsignup-page .form-group input[type="checkbox"], .signup-page .form-group input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

/* ---- Links ---- */
.orgsignup-page .eula-link,
.orgsignup-page .back-link,
.signup-page .eula-link,
.signup-page .back-link {
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1rem;
}

.orgsignup-page .eula-link:hover,
.orgsignup-page .back-link:hover,
.signup-page .eula-link:hover,
.signup-page .back-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ---- Submit Button ---- */
.orgsignup-page .save-btn,
.signup-page .save-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    background-color: var(--primary-hover);
    color: black;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.orgsignup-page .save-btn:hover:not(.loading):not(:disabled),
.signup-page .save-btn:hover:not(.loading):not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.orgsignup-page .save-btn:disabled,
.orgsignup-page .save-btn.loading,
.signup-page .save-btn:disabled,
.signup-page .save-btn.loading {
    background-color: var(--neutral-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.orgsignup-page .save-btn.loading i,
.orgsignup-page .save-btn.loading span,
.signup-page .save-btn.loading i,
.signup-page .save-btn.loading span {
    visibility: hidden;
}

.orgsignup-page .save-btn.loading::before,
.signup-page .save-btn.loading::before {
    content: "\f110";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1rem;
    color: white;
    animation: spin 1s linear infinite;
    position: absolute;
}

/* ---- Form Links ---- */
.orgsignup-page .form-links,
.signup-page .form-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* -------------------------------------------------------------
   5. POPUP (shared – used by EULA, success, error)
   ------------------------------------------------------------- */


.eula-popup {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.eula-popup[style*="flex"] { display: flex; }

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

.eula-popup-content {
    max-width: 800px;
    padding: 2rem;
}





.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #333;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 100;
}



.close-eula-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    margin-top: 1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.close-eula-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}


@media (max-width: 768px) {
    .orgsignup-page {
        padding: 80px 0.5rem 1rem;
    }
    .orgsignup-page .orgsignup-section {
        padding: 1rem;
        max-width: 100%;
    }
    .orgsignup-page .form-logo { width: 100px; }
    .orgsignup-page .save-btn { padding: 0.75rem; }
    .popup-content { width: 90%; padding: 1rem; }
    .eula-popup-content { max-width: 90%; padding: 1rem; }
    .close-btn { top: 8px; right: 8px; font-size: 1.1rem; }
}