/* Organization Selector Styles */

.organization-selector {
    position: relative;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.organization-selector.loading {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.organization-selector.empty {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

/* Selector Button */
.org-selector-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.org-selector-button:hover {
    background: var(--bg-hover, #e9ecef);
    border-color: var(--primary-color, #0066cc);
}

.org-selector-button:focus {
    outline: 2px solid var(--primary-color, #0066cc);
    outline-offset: 2px;
}

/* Org Info */
.org-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.org-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
    line-height: 1;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
}

.org-icon svg {
    width: 18px;
    height: 18px;
}

.org-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.org-name {
    font-weight: 600;
    color: var(--text-primary, #212529);
    font-size: 0.8125rem;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    width: 100%;
}

.org-role {
    font-size: 0.75rem;
    color: var(--text-secondary, #6c757d);
}

.dropdown-arrow {
    color: var(--text-secondary, #6c757d);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Dropdown */
.org-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

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

.org-dropdown-header {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #dee2e6);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, #6c757d);
}

.org-dropdown-item-wrapper {
    position: relative;
}

.org-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    transition: background 0.15s ease;
}

.org-dropdown-item:hover {
    background: var(--bg-hover, #f8f9fa);
}

.org-item-clickable {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.org-dropdown-item.active {
    background: var(--primary-light, #e7f3ff);
}

.org-dropdown-item.create-new {
    color: var(--primary-color, #0066cc);
    font-weight: 500;
}

.org-dropdown-item.create-new:hover {
    background: var(--primary-light, #e7f3ff);
}

.org-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.org-item-name {
    font-weight: 500;
    color: var(--text-primary, #212529);
}

.org-item-role {
    font-size: 0.8rem;
    color: var(--text-secondary, #6c757d);
}

.org-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.check-mark {
    color: var(--success-color, #28a745);
    font-weight: bold;
}

.btn-edit-org {
    padding: 0.375rem 0.5rem;
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.btn-edit-org:hover {
    background: var(--primary-light, #e7f3ff);
    border-color: var(--primary-color, #0066cc);
    transform: scale(1.05);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
    font-style: italic;
}

.org-dropdown-divider {
    height: 1px;
    background: var(--border-color, #dee2e6);
    margin: 0.25rem 0;
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary, #212529);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary, #212529);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #0066cc);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-cancel,
.btn-create,
.btn-create-org {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-cancel {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #212529);
}

.btn-cancel:hover {
    background: var(--bg-hover, #e9ecef);
}

.btn-create,
.btn-create-org {
    background: var(--primary-color, #0066cc);
    color: white;
}

.btn-create:hover,
.btn-create-org:hover {
    background: var(--primary-dark, #0052a3);
}

/* Responsive */
@media (max-width: 768px) {
    .org-selector-button {
        min-width: 200px;
    }

    .modal-content {
        padding: 1.5rem;
    }
}

