/* ===== MODALS ===== */

/* Circular Share Button */
.share-btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.share-btn-circle:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.12);
}

.share-btn-circle:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.share-btn-circle svg {
    stroke: #1a1a1a;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    overflow: auto;
    align-items: center;
    justify-content: center;
}

.modal.active,
.modal[style*="display: block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    padding: 48px 40px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: modalSlideIn 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== SHARE MODAL ===== */
.share-section {
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.share-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.share-link-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.share-link-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    font-family: 'Courier New', monospace;
}

.share-link-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.copy-link-btn {
    padding: 12px 24px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.copy-link-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
}

.copy-link-btn.copied {
    background: #27ae60;
}

.public-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.public-toggle-container label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.public-toggle-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.invite-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invite-inputs {
    display: flex;
    gap: 8px;
}

.invite-input-wrapper {
    position: relative;
    flex: 1;
}

.invite-email-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.invite-email-input:focus {
    outline: none;
    border-color: #4a90e2;
}

/* Username Autocomplete Dropdown */
.username-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: -1px;
}

.username-suggestion {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.username-suggestion:last-child {
    border-bottom: none;
}

.username-suggestion:hover {
    background: #f8f9fa;
}

.username-suggestion.selected {
    background: #e3f2fd;
}

.username-suggestion-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.username-suggestion-info {
    flex: 1;
    min-width: 0;
}

.username-suggestion-username {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.username-suggestion-email {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.username-suggestion-empty {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}


.invite-role-select {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

.invite-role-select:focus {
    outline: none;
    border-color: #4a90e2;
}

.invite-btn {
    padding: 12px 24px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.invite-btn:hover {
    background: #357abd;
}

.invite-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #eee;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.member-details {
    flex: 1;
}

.member-email {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.member-role {
    font-size: 12px;
    color: #666;
    text-transform: capitalize;
}

.member-actions {
    display: flex;
    gap: 8px;
}

.remove-member-btn {
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.remove-member-btn:hover {
    background: #c0392b;
}

.share-info {
    padding: 12px;
    background: rgba(74, 144, 226, 0.1);
    border-left: 3px solid #4a90e2;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    margin-top: 12px;
}

.share-info-icon {
    display: inline-block;
    margin-right: 8px;
    font-weight: 600;
    color: #4a90e2;
}

.empty-members {
    padding: 24px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ===== MINIMAL SHARE MODAL (Settings Style) ===== */
.share-modal-container {
    max-width: 680px;
    width: 92%;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.share-modal-container .modal-content {
    padding: 40px 40px 32px 40px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.share-modal-container .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.share-modal-container .modal-close:hover {
    background: #e9ecef;
}

.share-modal-container .modal-close svg {
    width: 18px;
    height: 18px;
    stroke: #666;
}

.share-modal-header {
    margin-bottom: 28px;
}

.share-icon {
    display: none;
}

.share-modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #1a1a1a;
}

.share-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.share-section {
    margin-bottom: 24px;
}

.share-section:last-child {
    margin-bottom: 0;
}

.share-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.share-link-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-link-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-link-wrapper .share-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #f8f9fa;
    color: #1a1a1a;
    font-family: 'SF Mono', Monaco, monospace;
    transition: all 0.2s ease;
}

.share-link-wrapper .share-link-input:focus {
    outline: none;
    border-color: #4a90e2;
    background: #fff;
}

.copy-link-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-link-btn:hover:not(:disabled) {
    background: #4a90e2;
    border-color: #4a90e2;
}

.copy-link-btn:hover:not(:disabled) svg {
    stroke: #fff;
}

.copy-link-btn.copied {
    background: #28a745;
    border-color: #28a745;
}

.copy-link-btn.copied svg {
    stroke: #fff;
}

.copy-link-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.copy-link-btn svg {
    stroke: #666;
    width: 16px;
    height: 16px;
    transition: stroke 0.2s ease;
}

.generate-link-btn {
    padding: 9px 16px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.generate-link-btn:hover {
    background: #357abd;
}

.generate-link-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.generate-link-btn svg {
    stroke: white;
    width: 16px;
    height: 16px;
}

.share-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.share-toggle:hover {
    background: #f8f9fa;
}

.share-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.share-toggle .toggle-text {
    font-size: 13px;
    color: #333;
}

.share-divider {
    height: 1px;
    background: #e9ecef;
    margin: 20px 0;
}

.invite-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.invite-email-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    transition: all 0.2s ease;
}

.invite-email-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.invite-role-select {
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    min-width: 110px;
    transition: all 0.2s ease;
}

.invite-role-select:focus {
    outline: none;
    border-color: #4a90e2;
}

.invite-submit-btn {
    padding: 9px 18px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.invite-submit-btn:hover {
    background: #357abd;
}

.invite-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading-members {
    padding: 32px;
    text-align: center;
    color: #999;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.members-list {
    max-height: none;
    overflow-y: visible;
}

.members-list:empty::before {
    content: 'No members yet';
    display: block;
    padding: 32px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
    border: 1px solid #f0f0f0;
    margin-bottom: 8px;
}

.member-item:last-child {
    margin-bottom: 0;
}

.member-item:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    background: #4a90e2;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-email {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-role-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.member-role-select:focus {
    outline: none;
    border-color: #4a90e2;
}

.member-role-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.member-item .remove-member-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.member-item .remove-member-btn:hover {
    background: #fee;
    border-color: #e74c3c;
}

.member-item .remove-member-btn svg {
    stroke: #e74c3c;
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .share-modal-container {
        width: 95%;
        max-width: 95%;
        max-height: 95vh;
    }
    
    .share-modal-header,
    .share-section {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .invite-input-group {
        flex-direction: column;
    }
    
    .invite-role-select,
    .invite-submit-btn {
        width: 100%;
    }
    
    .share-btn-circle {
        width: 40px;
        height: 40px;
        margin-right: 12px;
    }
}

.close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
}

.close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.modal-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* Small modal for connection label */
.modal-small {
    max-width: 480px;
    padding: 48px 40px;
}

.modal-small h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid rgba(221, 221, 221, 0.5);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.6);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.custom-field {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.custom-field input {
    flex: 1;
}

.custom-field button {
    padding: 0.3rem 0.8rem;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.custom-field button:hover {
    background-color: #c0392b;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.form-actions .btn-danger {
    margin-right: auto;
}

/* Import zone in modal */
.import-zone {
    margin-bottom: 20px;
}

.drop-zone {
    border: 2px dashed rgba(52, 152, 219, 0.4);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(248, 249, 250, 0.6);
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover {
    background: rgba(232, 244, 248, 0.8);
    border-color: rgba(41, 128, 185, 0.6);
}

.drop-zone.drag-over {
    background: rgba(212, 237, 218, 0.8);
    border-color: rgba(39, 174, 96, 0.6);
    border-style: solid;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-icon {
    font-size: 3rem;
}

.drop-text {
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 500;
}

.drop-or {
    color: #7f8c8d;
    margin: 5px 0;
    font-size: 0.9rem;
}

#quickImport {
    width: 100%;
    max-width: 500px;
    padding: 12px;
    border: 2px solid rgba(221, 221, 221, 0.5);
    border-radius: 10px;
    font-size: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

#quickImport:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.6);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* BibTeX paste area */
.bibtex-paste-area {
    width: 100%;
    max-width: 550px;
    margin-top: 10px;
}

.bibtex-paste-area textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(52, 152, 219, 0.4);
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 200px;
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
}

.bibtex-paste-area textarea:focus {
    outline: none;
    border-color: rgba(41, 128, 185, 0.8);
    background: rgba(255, 255, 255, 0.9);
}

.bibtex-paste-area button {
    margin-top: 10px;
    margin-right: 10px;
}

.btn-browse {
    padding: 10px 24px;
    background: white;
    border: 1px solid #3498db;
    color: #3498db;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-browse:hover {
    background: #3498db;
    color: white;
}

/* Import success summary */
.import-summary {
    background: #d4edda;
    border: 2px solid #27ae60;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}

.import-success-icon {
    width: 60px;
    height: 60px;
    background: #27ae60;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 15px;
}

.import-summary h3 {
    color: #155724;
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

.import-details {
    text-align: left;
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.import-details p {
    margin: 8px 0;
    color: #2c3e50;
    font-size: 0.95rem;
}

.import-details strong {
    color: #155724;
    display: inline-block;
    min-width: 80px;
}

#reimportBtn {
    margin-top: 10px;
}

/* Manual form toggle */
.manual-toggle {
    margin: 20px 0;
    text-align: center;
}

.toggle-manual-btn {
    background: transparent;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-manual-btn:hover {
    background: #e8f4f8;
}

.manual-form {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 1;
}

.manual-form.collapsed {
    max-height: 0;
    opacity: 0;
}

.import-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    display: none;
    text-align: center;
    backdrop-filter: blur(10px);
}

.import-status.show {
    display: block;
}

.import-status.loading {
    background: rgba(255, 243, 205, 0.9);
    color: #856404;
    border: 1px solid rgba(255, 238, 186, 0.8);
}

.import-status.success {
    background: rgba(212, 237, 218, 0.9);
    color: #155724;
    border: 1px solid rgba(195, 230, 203, 0.8);
}

.import-status.error {
    background: rgba(248, 215, 218, 0.9);
    color: #721c24;
    border: 1px solid rgba(245, 198, 203, 0.8);
}

/* Zone Color Modal */
.zone-color-modal {
    background: white;
    border: 2px solid #4a90e2;
}

.zone-color-label {
    color: #666;
}

.zone-custom-picker {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.zone-color-hex-input {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.zone-color-btn-cancel {
    background: #e0e0e0;
    color: #333;
}

.zone-color-btn-cancel:hover {
    background: #d0d0d0;
}

.zone-color-btn-apply {
    background: #4a90e2;
    color: white;
}

.zone-color-btn-apply:hover {
    background: #3a80d2;
}

/* ===== SHARE MODAL ===== */

.share-description {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.share-description p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.share-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.share-results {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
}

.share-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.share-result-item:last-child {
    border-bottom: none;
}

.share-result-success {
    color: #2ecc71;
}

.share-result-error {
    color: #e74c3c;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #4a90e2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.member-details {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-weight: 600;
    color: #2c3e50;
}

.member-email {
    font-size: 0.85rem;
    color: #666;
}

.member-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.member-role {
    padding: 4px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #666;
}

.member-remove-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.member-remove-btn:hover {
    background: #e74c3c;
    color: white;
}

/* ===== PREFERENCES MODAL ===== */

.preferences-modal {
    max-width: 900px;
    width: 90%;
    padding: 0;
    overflow: hidden;
}

.preferences-container {
    display: flex;
    min-height: 500px;
    max-height: 80vh;
}

/* Sidebar with tabs */
.preferences-sidebar {
    width: 220px;
    background: rgba(248, 249, 250, 0.6);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preferences-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 0.95rem;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.preferences-tab:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #2c3e50;
}

.preferences-tab.active {
    background: rgba(255, 255, 255, 0.8);
    color: #4a90e2;
    border-left-color: #4a90e2;
}

.preferences-tab svg {
    flex-shrink: 0;
}

/* Content area */
.preferences-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.preferences-panel {
    display: none;
}

.preferences-panel.active {
    display: block;
}

.preferences-panel h2 {
    margin: 0 0 32px 0;
    font-size: 1.75rem;
    color: #2c3e50;
    font-weight: 600;
}

.preferences-panel h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
}

.preferences-section {
    margin-bottom: 32px;
}

.preferences-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.preferences-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    transition: all 0.2s;
}

.preferences-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.preferences-input:readonly {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #2c3e50;
    cursor: default;
    padding: 0 !important;
    font-weight: 600;
    font-size: 1rem;
}

.preferences-display-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    padding: 4px 0;
}

.preferences-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preferences-input-group .preferences-input {
    flex: 1;
}

.preferences-input-prefix {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 500;
}

.preferences-hint {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 0.85rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Connected accounts */
.connected-accounts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.connected-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(74, 144, 226, 0.05);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 8px;
}

.connected-account svg {
    flex-shrink: 0;
}

.connected-account-info {
    flex: 1;
}

.connected-account-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.connected-account-email {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Danger zone */
.danger-zone {
    border: 2px solid rgba(231, 76, 60, 0.2);
    border-radius: 12px;
    padding: 24px;
    background: rgba(231, 76, 60, 0.02);
}

.danger-zone h3 {
    color: #e74c3c;
    margin-bottom: 12px;
}

.danger-zone p {
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.6;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Construction notice */
.construction {
    text-align: center;
    padding: 60px 40px;
}

.construction svg {
    color: #adb5bd;
    margin-bottom: 24px;
}

.construction h3 {
    color: #495057;
    margin-bottom: 12px;
}

.construction p {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Close button */
.preferences-modal .close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    z-index: 10;
}

.preferences-modal .close-modal:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2c3e50;
}

/* Toggle Switch */
.preferences-toggle-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.preferences-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.preferences-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.preferences-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.preferences-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.preferences-toggle input:checked + .preferences-toggle-slider {
    background-color: #4a90e2;
}

.preferences-toggle input:checked + .preferences-toggle-slider:before {
    transform: translateX(24px);
}

.preferences-toggle-label {
    font-size: 0.95rem;
    color: #495057;
    font-weight: 500;
}

.preferences-warning {
    color: #e67e22 !important;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .preferences-modal {
        width: 95%;
        max-width: none;
    }
    
    .preferences-container {
        flex-direction: column;
    }
    
    .preferences-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
        gap: 8px;
    }
    
    .preferences-tab {
        padding: 10px 16px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    
    .preferences-tab.active {
        border-left-color: transparent;
        border-bottom-color: #4a90e2;
    }
    
    .preferences-content {
        padding: 24px;
    }
    
    .preferences-panel h2 {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }
}

