/* Share Project Modal - Professional Capsule/Pill Style */

.share-project-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.share-project-modal {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 24, 33, 0.98), rgba(15, 18, 25, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(40px) saturate(130%);
    -webkit-backdrop-filter: blur(40px) saturate(130%);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.05);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 28px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.project-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-icon-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    text-transform: uppercase;
}

.project-header-info {
    flex: 1;
    min-width: 0;
}

.project-title {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin: 0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
}

.subtitle-share-icon {
    width: 12px;
    height: 12px;
    opacity: 0.6;
    filter: brightness(0.8);
}

.modal-content {
    padding: 20px 28px 28px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

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

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.members-section, .invite-section {
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.section-count {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.member-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.member-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-email {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-invited-date {
    color: rgba(255, 193, 7, 0.8);
    font-size: 11px;
    margin-top: 2px;
    font-style: italic;
}

.member-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.role-pill {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

.role-pill.role-owner {
    background: rgba(245, 166, 35, 0.15);
    color: #f5a623;
    border-color: rgba(245, 166, 35, 0.3);
}

.role-pill.role-editor {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border-color: rgba(76, 175, 80, 0.3);
}

.role-pill.role-viewer {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
    border-color: rgba(33, 150, 243, 0.3);
}

.status-pill.pending {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-pill {
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid;
    flex-shrink: 0;
}

.action-pill.remove {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border-color: rgba(244, 67, 54, 0.3);
}

.action-pill.remove:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.5);
    transform: translateY(-1px);
}

.action-pill.cancel {
    background: rgba(156, 156, 156, 0.1);
    color: #9c9c9c;
    border-color: rgba(156, 156, 156, 0.3);
}

.action-pill.cancel:hover {
    background: rgba(156, 156, 156, 0.2);
    border-color: rgba(156, 156, 156, 0.5);
    transform: translateY(-1px);
}

/* Invite Form Pill */
.invite-form-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 6px 6px 6px 18px;
    transition: all 0.2s ease;
}

.invite-form-pill:focus-within {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(33, 150, 243, 0.4);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.invite-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    outline: none;
    min-width: 0;
}

.invite-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Fix autocomplete white background issue */
.invite-input:-webkit-autofill,
.invite-input:-webkit-autofill:hover,
.invite-input:-webkit-autofill:focus,
.invite-input:-webkit-autofill:active {
    -webkit-background-clip: text;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
    box-shadow: inset 0 0 20px 20px transparent !important;
    background-color: transparent !important;
    caret-color: #fff;
}

/* Custom Pill Dropdown */
.role-pill-dropdown {
    position: relative;
    min-width: 120px;
    cursor: pointer;
}

.role-pill-selected {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    cursor: pointer;
    user-select: none;
}

.role-pill-selected:hover,
.role-pill-selected:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    outline: none;
}

.role-pill-selected:focus {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.role-pill-dropdown.open .role-pill-selected {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.role-pill-text {
    flex: 1;
}

.role-pill-arrow {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    margin-left: 8px;
}

.role-pill-dropdown.open .role-pill-arrow {
    transform: rotate(180deg);
    color: rgba(255, 255, 255, 0.8);
}

.role-pill-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 24, 33, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.role-pill-dropdown.open .role-pill-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.role-pill-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.role-pill-option:hover,
.role-pill-option:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    outline: none;
}

.role-pill-option.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.role-pill-option.active::after {
    content: '✓';
    position: absolute;
    right: 12px;
    color: rgba(33, 150, 243, 0.8);
    font-weight: bold;
}

.role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

.role-dot.viewer {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.6);
}

.role-dot.editor {
    background: linear-gradient(135deg, #4caf50, #45a049);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.role-text {
    flex: 1;
}

/* Dynamic role colors for selected pill */
.role-pill-selected[data-value="viewer"] {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.05));
    border-color: rgba(33, 150, 243, 0.2);
}

.role-pill-selected[data-value="editor"] {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
    border-color: rgba(76, 175, 80, 0.2);
}

.role-pill-selected[data-value="viewer"]:hover {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(33, 150, 243, 0.08));
    border-color: rgba(33, 150, 243, 0.3);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.role-pill-selected[data-value="editor"]:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.08));
    border-color: rgba(76, 175, 80, 0.3);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.invite-btn-pill {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border: none;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.invite-btn-pill:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    transform: translateY(-1px);
}

.invite-btn-pill:active {
    transform: translateY(0);
}

.invitation-status {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.status-message {
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    animation: slideInStatus 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.status-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    pointer-events: none;
}

.status-message.success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(76, 175, 80, 0.15));
    color: #66ff66;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3), 
                0 0 0 1px rgba(255, 255, 255, 0.2) inset,
                0 0 30px rgba(76, 175, 80, 0.2);
}

.status-message.success::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(76, 175, 80, 0.1));
}

.status-message.error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.25), rgba(244, 67, 54, 0.15));
    color: #ff8a80;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 20px rgba(244, 67, 54, 0.3), 
                0 0 0 1px rgba(255, 255, 255, 0.2) inset,
                0 0 30px rgba(244, 67, 54, 0.2);
}

.status-message.error::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(244, 67, 54, 0.1));
}

@keyframes slideInStatus {
    from { 
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .share-project-modal {
        margin: 20px;
        max-height: calc(100vh - 40px);
        max-width: 100%;
    }
    
    .modal-header {
        padding: 20px 20px 16px;
    }
    
    .modal-content {
        padding: 16px 20px 20px;
    }
    
    .project-icon-circle {
        width: 48px;
        height: 48px;
    }
    
    .project-icon-initials {
        font-size: 18px;
    }
    
    .member-pill {
        flex-wrap: wrap;
    }
    
    .member-badges, .action-pill {
        margin-left: 50px;
    }
    
    .status-message {
        padding: 10px 20px;
        font-size: 12px;
        max-width: 90%;
        text-align: center;
    }
}
