/* ==================== Common UI Components ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background-color: var(--primary-bg);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    width: 90%;
    max-width: 500px;
    padding: 20px;
}

.modal-title {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
    color: var(--primary-text);
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 30%, transparent);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-button {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid var(--border-color);
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

.modal-button.primary {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.modal-button.primary:hover {
    background-color: var(--accent-hover);
}

.error-message {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 5px;
}

/* Repo list for create mode */
.repo-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 8px;
}

.repo-list-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.repo-list-item:last-child {
    border-bottom: none;
}

.repo-list-item:hover {
    background-color: var(--hover-bg);
}

.repo-list-item.selected {
    background-color: var(--accent-bg);
    border-left: 3px solid var(--accent-color);
}

/* Loading & Spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--secondary-text);
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--accent-color);
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

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

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--primary-text);
    color: var(--primary-bg);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 2000;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background-color: var(--success-color);
    color: white;
}

.toast.error {
    background-color: var(--danger-color);
    color: white;
}
